/**assetcss
 * Traffic Portal Link Shortener - Frontend Styles
 * Modernized with Bootstrap 5 utilities while preserving the original palette
 */

:root {
    --tp-primary: #3c7ae5;
    --tp-primary-contrast: #1c4f9f;
    --tp-accent: #22b573;
    --tp-accent-dark: #1c9d63;
    --tp-secondary: #5f8cf3;
    --tp-secondary-dark: #416bc7;
    --tp-warning: #f0ad4e;
    --tp-warning-dark: #ec971f;
    --tp-surface: #ffffff;
    --tp-surface-soft: #f6fbff;
    --tp-section: #e7f1ff;
    --tp-text: #1e2f50;
    --tp-muted: #5f6f8c;
    --tp-border: #cfe2ff;
    --tp-shadow: 0 18px 45px -30px rgba(30, 79, 159, 0.7);
}

.tp-link-shortener-wrapper {
    font-family: 'Poppins', 'Trebuchet MS', 'Segoe UI', sans-serif;
    color: var(--tp-text);
    font-size: 0.98rem;
    line-height: 1.6;
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.35), transparent 30%),
        radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.32), transparent 26%),
        linear-gradient(180deg, #dff0ff 0%, #c8e0ff 50%, #dff4ff 100%);
    padding: 1rem;
    border-radius: 1.25rem;
}

.tp-link-shortener-wrapper.container {
    max-width: none;
    width: 100%;
}

/* Escape block-theme content clamps so the form can span the page */
.entry-content .tp-link-shortener-wrapper,
.wp-block-post-content .tp-link-shortener-wrapper {
    max-width: none;
    width: 100%;
}

.tp-save-link-reminder {
    display: block;
    background: rgba(60, 122, 229, 0.12);
    color: var(--tp-primary-contrast);
    border: 1px dashed rgba(60, 122, 229, 0.4);
    border-radius: 999px;
    padding: 0.8rem 1.1rem;
    text-align: center;
    letter-spacing: 0.05em;
    font-weight: 700;
    cursor: pointer;
}

.tp-save-link-reminder:hover {
    background: rgba(60, 122, 229, 0.2);
    color: var(--tp-primary-contrast);
}

.tp-card {
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(207, 226, 255, 0.8);
    box-shadow: var(--tp-shadow);
    padding: 1.5rem 1.25rem;
}

.tp-hero-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding-left: 1.25rem;
}

.tp-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgb(43, 77, 236);
    font-size: 1.5rem;
}

.tp-title {
    font-size: clamp(1.2rem, 1.8vw, 1.5rem);
    font-weight: 700;
    color: rgb(43, 77, 236);
    letter-spacing: 0.01em;
}

.tp-form-control {
    border-color: var(--tp-border);
    border-radius: 0.625rem;
    padding: 0.95rem 1.1rem;
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #f9fbff;
}

.tp-form-control:focus {
    border-color: var(--tp-primary);
    box-shadow: 0 0 0 0.2rem rgba(60, 122, 229, 0.16);
}

/* Valid State */
.tp-form-control.is-valid {
    border-color: var(--tp-accent);
}

.tp-form-control.is-valid:focus {
    box-shadow: 0 0 0 0.2rem rgba(34, 181, 115, 0.18);
}

/* Invalid State */
.tp-form-control.is-invalid {
    border-color: #f05a5a;
}

.tp-form-control.is-invalid:focus {
    box-shadow: 0 0 0 0.2rem rgba(240, 90, 90, 0.15);
}

/* Increase specificity to override theme styles */
.tp-link-shortener-wrapper form .tp-plain-input,
.tp-link-shortener-wrapper .tp-plain-input {
    border-color: transparent;
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 1rem 1rem;
    font-weight: 600;
    font-size: 1.05rem;
    border-radius: 0 0.625rem 0.625rem 0;
}

form .tp-plain-input:focus,
.tp-plain-input:focus {
    outline: none;
    box-shadow: none;
}

/* Smaller font size for placeholder text */
.tp-plain-input::placeholder {
    font-size: 0.85rem;
    font-weight: 500;
}

.tp-plain-input.is-invalid {
    box-shadow: inset 0 0 0 2px rgba(240, 90, 90, 0.5);
    border-radius: 0.625rem;
}

.input-group>.form-control.tp-form-control,
.input-group>.input-group-text {
    border-radius: 0.625rem;
}

.input-group .input-group-text {
    color: var(--tp-muted);
    border-color: var(--tp-border);
    background-color: var(--tp-surface);
}

.tp-label {
    font-weight: 700;
    color: var(--tp-primary-contrast);
    letter-spacing: 0.04em;
}

.tp-input-visual {
    display: flex;
    align-items: stretch;
    border: 3px solid var(--tp-border);
    border-radius: 0.75rem;
    background: linear-gradient(180deg, #f8fcff 0%, #eef5ff 100%);
    box-shadow: var(--tp-shadow);
}

/* Floating label wrapper */
.tp-floating-label-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

/* Floating label - always floated at top */
.tp-floating-label {
    position: absolute;
    left: -2.3rem;
    top: -.7rem;
    padding: 0 0.125rem;
    color: rgb(43, 77, 236);
    font-size: 0.75rem;
    font-weight: 700;
    pointer-events: none;
    transition: color 0.2s ease;
    background: white;
    margin-bottom: 0;
    letter-spacing: 0.04em;
}

/* Green label when valid */
.tp-plain-input.is-valid~.tp-floating-label {
    color: var(--tp-accent);
}

/* Red label when invalid */
.tp-plain-input.is-invalid~.tp-floating-label {
    color: #f05a5a;
}

.tp-destination-field .tp-input-visual {
    border-color: rgb(43, 77, 236);
    box-shadow: 0 18px 40px -28px rgba(43, 77, 236, 0.95);
    background: linear-gradient(180deg, #f8fcff 0%, #eef5ff 100%);
}

/* Invalid state - Red border */
.tp-destination-field .tp-input-visual:has(.is-invalid) {
    border-color: #f05a5a;
    box-shadow: 0 18px 40px -28px rgba(240, 90, 90, 0.95);
}

/* Valid state - Green border */
.tp-destination-field .tp-input-visual:has(.is-valid) {
    border-color: var(--tp-accent);
    box-shadow: 0 18px 40px -28px rgba(34, 181, 115, 0.95);
    background: linear-gradient(180deg, rgba(240, 255, 248, 0.9) 0%, #f7fffb 100%);
}

.tp-keyword-field .tp-input-visual {
    border-color: rgb(43, 77, 236);
    box-shadow: 0 18px 40px -28px rgba(43, 77, 236, 0.95);
}

/* Keyword field icon button */
.tp-keyword-field .tp-icon-btn {
    color: rgb(43, 77, 236);
    transition: color 0.2s ease;
}

/* Keyword field floating label */
.tp-keyword-field .tp-floating-label {
    color: rgb(43, 77, 236);
}

.tp-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--tp-primary-contrast);
    font-size: 1.25rem;
    border-radius: calc(0.75rem - 3px) 0 0 calc(0.75rem - 3px);
    transition: color 0.2s ease, background-color 0.2s ease;
}


.tp-submit-btn {
    border-radius: 0 calc(0.75rem - 3px) calc(0.75rem - 3px) 0;
    border-left: 1px solid rgba(43, 77, 236, 0.12);
    color: rgb(43, 77, 236);
    min-width: 56px;
    padding: 0.85rem 1rem;
    background: linear-gradient(180deg, rgba(248, 252, 255, 0.95) 0%, #e5edff 100%);
}

.tp-link-shortener-wrapper .tp-submit-btn.disabled,
.tp-link-shortener-wrapper .tp-submit-btn:disabled {
    opacity: 0.6;
    color: var(--tp-muted);
    background: rgba(240, 242, 250, 0.9);
    cursor: not-allowed;
}

.tp-destination-field .tp-icon-btn {
    color: rgb(43, 77, 236);
    transition: color 0.2s ease;
}

/* Green icon when valid */
.tp-destination-field .tp-input-visual:has(.is-valid) .tp-icon-btn {
    color: var(--tp-accent);
}

.tp-icon-btn:hover,
.tp-icon-btn:focus-visible {
    color: var(--tp-primary);
    background: rgba(60, 122, 229, 0.08);
}

.tp-link-shortener-wrapper .tp-submit-btn:hover:not(:disabled),
.tp-link-shortener-wrapper .tp-submit-btn:focus-visible:not(:disabled) {
    color: #fff;
    background: linear-gradient(90deg, #3673e1 0%, #2b63c8 100%);
}


.tp-field-hint {
    color: var(--tp-muted);
    font-style: italic;
    margin-top: 0.35rem;
}

.tp-form-group {
    background: rgba(255, 255, 255, 0.65);
    border-radius: 0.75rem;
}

.tp-trial-message {
    border-radius: 0.75rem;
    background: rgba(240, 173, 78, 0.12);
    border: 1px solid rgba(240, 173, 78, 0.3);
    color: var(--tp-text);
}

.tp-trial-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 0.625rem;
    background: rgba(240, 173, 78, 0.2);
    color: var(--tp-warning);
    font-size: 1.25rem;
}

.tp-action-buttons .tp-btn {
    min-width: 160px;
}

.tp-or {
    color: var(--tp-muted);
    font-size: 0.9rem;
}

.tp-section {
    background: var(--tp-section);
    border-radius: 1rem;
    border: 1px solid rgba(60, 122, 229, 0.2);
}

.tp-section-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--tp-primary-contrast);
    font-weight: 600;
    font-size: 1.1rem;
}

.tp-section-title i {
    color: var(--tp-primary);
}

.tp-section-description {
    color: var(--tp-muted);
    line-height: 1.6;
    font-size: 0.94rem;
}

.tp-help-text {
    color: var(--tp-muted);
    font-size: 0.84rem;
}

.tp-result-panel {
    background: #f8fbff;
    border: 1px solid #d7e8ff;
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 18px 38px -30px rgba(30, 79, 159, 0.65);
}

.tp-result-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1.5rem;
    align-items: center;
}

.tp-result-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tp-meta-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-style: italic;
    color: var(--tp-muted);
}

.tp-meta-label {
    color: var(--tp-primary-contrast);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.tp-expiry-time {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    background: rgba(60, 122, 229, 0.08);
    color: var(--tp-primary-contrast);
    border-radius: 0.5rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.tp-short-url-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: #eef4ff;
    border: 2px solid #c7d9ff;
    border-radius: 0.625rem;
    padding: 0.55rem 0.75rem;
}

.tp-short-url-row i {
    color: var(--tp-primary-contrast);
    font-size: 1.05rem;
}

.tp-short-url-link {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--tp-primary-contrast);
    font-weight: 700;
    font-size: 1.02rem;
    text-decoration: underline;
    padding: 0.5rem 0;
    display: block;
    word-break: break-all;
}

.tp-short-url-link:hover {
    color: var(--tp-primary-hover);
}

.tp-short-url-link:focus {
    outline: none;
    box-shadow: none;
}

.tp-short-url-row .tp-btn-copy {
    background: transparent;
    color: var(--tp-primary-contrast);
    border: 1px solid rgba(44, 102, 204, 0.2);
    padding: 0.65rem 0.9rem;
}

.tp-short-url-row .tp-btn-copy:hover,
.tp-short-url-row .tp-btn-copy:focus {
    background: rgba(60, 122, 229, 0.1);
    color: var(--tp-primary);
}

.tp-result-qr {}

.tp-qr-section-wrapper {
    margin-top: 0;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.5s ease-in-out;
}

.tp-qr-section-wrapper.tp-slide-down {
    max-height: 480px;
    opacity: 1;
}

.tp-qr-card {
    background: #fff;
    border: 1px solid #dce9ff;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 16px 40px -32px rgba(30, 79, 159, 0.5);
    min-width: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.tp-qr-code-container {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tp-surface);
    border: 1px dashed rgba(91, 192, 222, 0.35);
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.tp-qr-code-container canvas {
    max-width: 100%;
    height: auto;
}

/* QR Code Dialog Styles */
.tp-qr-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: tp-fade-in 0.2s ease-out;
}

@keyframes tp-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tp-qr-dialog {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-width: 280px;
    max-width: 90vw;
    animation: tp-slide-up 0.2s ease-out;
}

@keyframes tp-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tp-qr-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e9ecef;
}

.tp-qr-dialog-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--tp-text);
}

.tp-qr-dialog-close {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--tp-muted);
    font-size: 1.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.tp-qr-dialog-close:hover {
    color: var(--tp-text);
}

.tp-qr-dialog-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tp-qr-dialog-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--tp-surface);
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--tp-text);
    transition: all 0.2s;
    width: 100%;
    text-align: left;
}

.tp-qr-dialog-btn:hover {
    background: var(--tp-primary);
    border-color: var(--tp-primary);
    color: #fff;
}

.tp-qr-dialog-btn i {
    width: 1.25rem;
    text-align: center;
}

/* Screenshot Preview Styles */
.tp-qr-and-preview-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    padding-top: 1em;
}

.tp-screenshot-card {
    background: #fff;
    border: 1px solid #dce9ff;
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 16px 40px -32px rgba(30, 79, 159, 0.5);
    min-width: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Usage Stats Styles */
.tp-usage-stats {
    width: 100%;
    margin-bottom: 0.75rem;
}

.tp-usage-stats-row {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.tp-usage-stat {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 0.35rem;
}

.tp-usage-stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--tp-text, #1a2b4a);
}

.tp-usage-stat-label {
    font-size: 0.875rem;
    color: var(--tp-text-muted, #6b7c93);
}

.tp-screenshot-preview {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    position: relative;
}

.tp-screenshot-img {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    border: 1px solid #dce9ff;
    box-shadow: 0 4px 12px rgba(30, 79, 159, 0.15);
    object-fit: cover;
    transition: opacity 0.3s ease;
}

/* Initial loading state - show spinner before any screenshot is captured */
.tp-screenshot-preview.tp-screenshot-loading {
    position: relative;
}

.tp-screenshot-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(60, 122, 229, 0.2);
    border-top-color: var(--tp-primary);
    border-radius: 50%;
    animation: tp-screenshot-spin 0.8s linear infinite;
}

/* Hide spinner when preview has loaded */
.tp-screenshot-preview.tp-screenshot-loaded .tp-screenshot-spinner {
    display: none;
}

/* Loading state during capture (when replacing image) */
.tp-screenshot-preview.loading .tp-screenshot-img {
    opacity: 0.5;
}

/* Error state - dim the spinner to indicate failure */
.tp-screenshot-preview.tp-screenshot-error .tp-screenshot-spinner {
    opacity: 0.3;
    border-color: rgba(240, 173, 78, 0.2);
    border-top-color: var(--tp-warning);
}

@keyframes tp-screenshot-spin {
    to {
        transform: rotate(360deg);
    }
}

.tp-screenshot-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.tp-screenshot-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    background: rgba(34, 181, 115, 0.12);
    color: var(--tp-accent-dark);
    border: 1px solid rgba(34, 181, 115, 0.3);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.tp-screenshot-time {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    background: rgba(60, 122, 229, 0.08);
    color: var(--tp-primary-contrast);
    border: 1px solid rgba(60, 122, 229, 0.2);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Screenshot Expiry Timer */
.tp-screenshot-expiry-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(240, 173, 78, 0.1);
    color: #d97706;
    border: 1px solid rgba(240, 173, 78, 0.3);
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    width: 100%;
    text-align: center;
}

.tp-screenshot-expiry-text {
    font-weight: 500;
}

.tp-screenshot-expiry-countdown {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* Snackbar Styles */
.tp-snackbar {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 9999;
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 1rem;
    min-width: 280px;
    max-width: 90vw;
}

.tp-snackbar.tp-snackbar-show {
    bottom: 2rem;
}

.tp-snackbar i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* Success Snackbar */
.tp-snackbar-success {
    background: rgba(34, 181, 115, 0.95);
    box-shadow: 0 8px 24px rgba(34, 181, 115, 0.4);
}

/* Error Snackbar */
.tp-snackbar-error {
    background: rgba(240, 90, 90, 0.95);
    box-shadow: 0 8px 24px rgba(240, 90, 90, 0.4);
}

/* Warning Snackbar */
.tp-snackbar-warning {
    background: rgba(240, 173, 78, 0.95);
    box-shadow: 0 8px 24px rgba(240, 173, 78, 0.4);
}

/* Info Snackbar */
.tp-snackbar-info {
    background: rgba(60, 122, 229, 0.95);
    box-shadow: 0 8px 24px rgba(60, 122, 229, 0.4);
}

.tp-btn {
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.tp-btn i {
    font-size: 1rem;
}

.tp-btn:focus-visible {
    outline: 2px solid rgba(91, 192, 222, 0.4);
    outline-offset: 2px;
}

.tp-btn-primary {
    background: linear-gradient(90deg, #3673e1 0%, #2b63c8 100%);
    color: #fff;
    box-shadow: 0 18px 36px -24px rgba(54, 115, 225, 0.8);
}

.tp-btn-primary:hover,
.tp-btn-primary:focus {
    background: linear-gradient(90deg, #2f67d1 0%, #2457b0 100%);
    color: #fff;
    transform: translateY(-2px);
}

#tp-destination-field-group {
    transition: width 300ms ease, height 300ms ease;
}

.tp-cta-button {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    padding: 1.05rem 1.25rem;
}

.tp-btn-register {
    background: var(--tp-accent);
    color: #fff;
}

.tp-btn-register:hover,
.tp-btn-register:focus {
    background: var(--tp-accent-dark);
    color: #fff;
}

.tp-btn-login {
    background: var(--tp-primary);
    color: #fff;
}

.tp-btn-login:hover,
.tp-btn-login:focus {
    background: var(--tp-primary-contrast);
    color: #fff;
}

.tp-btn-copy {
    background: var(--tp-secondary);
    color: #fff;
}

.tp-btn-copy:hover,
.tp-btn-copy:focus {
    background: var(--tp-secondary-dark);
    color: #fff;
}

.tp-btn-download-qr {
    background: var(--tp-warning);
    color: #fff;
}

.tp-btn-download-qr:hover,
.tp-btn-download-qr:focus {
    background: var(--tp-warning-dark);
    color: #fff;
}

.tp-try-it {
    background: rgba(60, 122, 229, 0.08);
    border-color: rgba(60, 122, 229, 0.2);
    color: var(--tp-primary-contrast);
}

.tp-loading {
    color: var(--tp-muted);
}

.tp-spinner {
    width: 3rem;
    height: 3rem;
}

.tp-error-message {
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tp-error-message i {
    font-size: 1.2rem;
}

.tp-screenshot-preview img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.tp-link-shortener-wrapper {
    margin: 1em 0;
}

#tp-result-section {
    margin: 1em 0;
}

#tmp-tp-expiry-row {
    display: none;
}

/* Keyframe animation for initial slide */
@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.tp-qr-section-wrapper.tp-slide-down .tp-qr-card {
    animation: slideDown 0.5s ease-out;
}

@media (max-width: 991.98px) {
    .tp-result-grid {
        grid-template-columns: 1fr;
    }
}

@keyframes tp-slideUpMobile {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@media (max-width: 767.98px) {
    .tp-card {
        border-radius: 1rem;
    }

    .tp-title {
        font-size: 1.5rem;
    }

    .tp-action-buttons .tp-btn {
        min-width: 0;
    }

    .tp-qr-code-container {
        min-height: 180px;
    }

    .tp-input-visual {
        flex-direction: row;
    }

    /* QR dialog → bottom sheet */
    .tp-qr-dialog-overlay {
        align-items: flex-end;
    }

    .tp-qr-dialog {
        width: 100%;
        max-width: 100%;
        min-width: auto;
        border-radius: 1rem 1rem 0 0;
        max-height: 85vh;
        max-height: 85dvh;
        overflow-y: auto;
        animation: tp-slideUpMobile 0.3s ease;
    }

    .tp-qr-and-preview-container {
        grid-template-columns: 1fr;
    }
}

/* Phone form sizing — full-width inputs with touch targets */
@media (max-width: 479.98px) {
    .tp-link-shortener-wrapper {
        padding: 0.75rem;
    }

    .tp-card {
        padding: 1rem 0.75rem;
    }

    .tp-input-visual {
        border-width: 2px;
    }

    .tp-icon-btn {
        min-width: 44px;
        padding: 0.75rem;
    }

    .tp-submit-btn {
        min-width: 44px;
        padding: 0.75rem;
    }

    .tp-snackbar {
        min-width: auto;
        width: calc(100% - 2rem);
    }
}
