:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --accent: #ec4899;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

body.site-body {
    background:
        radial-gradient(1100px 520px at 8% -8%, rgba(99, 102, 241, 0.18), transparent 58%),
        radial-gradient(900px 480px at 92% 0%, rgba(236, 72, 153, 0.12), transparent 55%),
        var(--bg-color);
}

.app-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.logo i {
    color: var(--accent);
}

.logo h1 {
    font-weight: 700;
    letter-spacing: -1px;
}

.logo span {
    color: var(--primary);
}

.tagline {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Card */
.card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 1rem;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.card h2 {
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* File Drop Area */
.file-drop-area {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    padding: 2rem;
    border: 2px dashed var(--border);
    border-radius: 0.75rem;
    transition: 0.2s;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
}

.file-drop-area.is-active {
    background-color: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
}

.fake-btn {
    background-color: var(--border);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.file-msg {
    font-size: small;
    color: var(--text-muted);
}

.file-input {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    cursor: pointer;
    opacity: 0;
}

/* Preview Section */
.preview-section {
    margin-top: 2rem;
}

.preview-container {
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    position: relative;
    /* For overlay positioning */
}

#imageCanvas {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Controls Section */
.controls-section {
    margin-bottom: 2rem;
}

.transform-controls {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.control-btn {
    background: var(--bg-color);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.control-btn i {
    font-size: 1rem;
}

.action-btn {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.download-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    width: 100%;
}

.format-selector-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.format-selector-group label {
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
}

.format-selector {
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    background: var(--bg-color);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 150px;
}

.format-selector:hover {
    border-color: var(--primary);
}

.format-selector:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Statistics Table */
.stats-table {
    background: var(--bg-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-top: 2rem;
}

.stats-table h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--text-main);
}

.stats-table table {
    width: 100%;
    border-collapse: collapse;
}

.stats-table tr {
    border-bottom: 1px solid var(--border);
}

.stats-table tr:last-child {
    border-bottom: none;
}

.stat-label {
    text-align: left;
    padding: 1rem;
    color: var(--text-muted);
    font-weight: 600;
    width: 40%;
}

.stat-value {
    text-align: right;
    padding: 1rem;
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.1rem;
}

.unit-selector {
    margin-left: 0.5rem;
    padding: 0.4rem 0.6rem;
    border-radius: 0.35rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.unit-selector:hover {
    border-color: var(--primary);
}

.unit-selector:focus {
    outline: none;
    border-color: var(--primary);
}

/* Result Area */
.result-area {
    margin-top: 2rem;
    min-height: 20px;
}

.loading {
    color: var(--primary);
    font-weight: 600;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.success {
    color: #10b981;
    font-weight: 600;
    animation: none;
}

.error {
    color: #ef4444;
    font-weight: 600;
}

/* Error Display Area - Below Download Button */
.error-display-area {
    padding: 15px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.2) 100%);
    border: 2px solid #ef4444;
    border-radius: 0.75rem;
    margin-top: 15px;
    animation: error-pulse 2s ease-in-out infinite;
}

.error-display-area .error {
    color: #fecaca;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

@keyframes error-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

/* Limit Error Modal */
.limit-error-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.limit-error-modal-content {
    background: var(--card-bg);
    border: 2px solid #ef4444;
    border-radius: 1rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.limit-error-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.15) 100%);
}

.limit-error-modal-header h3 {
    color: #fecaca;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.limit-error-modal-header h3 i {
    color: #ef4444;
}

.limit-error-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.limit-error-modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.limit-error-modal-body {
    padding: 2rem;
}

.limit-error-message {
    color: #fecaca;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1rem;
    padding: 15px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 0.5rem;
    border-left: 4px solid #ef4444;
}

.limit-error-details {
    color: var(--text-muted);
    font-size: 0.95rem;
    text-align: center;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.limit-error-details strong {
    color: var(--text-main);
}

.limit-error-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.limit-error-modal-cancel {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s;
    margin-top: 10px;
}

.limit-error-modal-cancel:hover {
    background: var(--border);
    color: var(--text-main);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* General Error/Notice Modal */
.error-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.error-modal-content {
    background: var(--card-bg);
    border: 2px solid #ef4444;
    border-radius: 1rem;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.error-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.15) 100%);
}

.error-modal-header h3 {
    color: #fecaca;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.error-modal-header h3 i {
    color: #ef4444;
}

.error-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.error-modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.error-modal-body {
    padding: 2rem;
}

.error-modal-message {
    color: #fecaca;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 15px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 0.5rem;
    border-left: 4px solid #ef4444;
    line-height: 1.6;
}

.error-modal-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.error-modal-ok {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s;
    width: 100%;
}

.error-modal-ok:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.4);
}

/* Success Notice Modal Variant */
.error-modal.success .error-modal-content {
    border-color: #10b981;
}

.error-modal.success .error-modal-header {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.15) 100%);
}

.error-modal.success .error-modal-header h3 {
    color: #a7f3d0;
}

.error-modal.success .error-modal-header h3 i {
    color: #10b981;
}

.error-modal.success .error-modal-message {
    color: #a7f3d0;
    background: rgba(16, 185, 129, 0.1);
    border-left-color: #10b981;
}

.error-modal.success .error-modal-ok {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.error-modal.success .error-modal-ok:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

/* Info Notice Modal Variant */
.error-modal.info .error-modal-content {
    border-color: #3b82f6;
}

.error-modal.info .error-modal-header {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.15) 100%);
}

.error-modal.info .error-modal-header h3 {
    color: #bfdbfe;
}

.error-modal.info .error-modal-header h3 i {
    color: #3b82f6;
}

.error-modal.info .error-modal-message {
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #3b82f6;
}

.error-modal.info .error-modal-ok {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.error-modal.info .error-modal-ok:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
}

/* Loading Bar Styles */
.loading-container {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin: 1rem 0;
    text-align: center;
}

.loading-bar-wrapper {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 1rem 0;
    position: relative;
}

.loading-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
    background-size: 200% 100%;
    border-radius: 10px;
    animation: loading-shimmer 1.5s ease-in-out infinite;
    width: 100%;
    position: relative;
    transition: width 0.3s ease;
}

.loading-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: loading-shine 1.5s ease-in-out infinite;
}

@keyframes loading-progress {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes loading-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes loading-shine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.loading-text {
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.loading-text i {
    color: var(--primary);
    animation: spin 1s linear infinite;
}

.loading-progress-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    font-weight: 600;
    text-align: center;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

footer {
    text-align: center;
    margin-top: 3rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* FAQ Section Styles */
.faq-section {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-question {
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.faq-answer {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.faq-answer p {
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }

    .logo {
        font-size: 2rem;
    }

    .card {
        padding: 1.5rem;
    }

    .transform-controls {
        gap: 0.5rem;
    }

    .control-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .preview-container {
        padding: 1rem;
    }

    .stat-label,
    .stat-value {
        padding: 0.75rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .transform-controls {
        flex-direction: column;
        width: 100%;
    }

    .control-btn {
        width: 100%;
        justify-content: center;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }

    .logo {
        font-size: 1.5rem;
        gap: 0.5rem;
    }

    .logo h1 {
        font-size: 1.5rem;
    }
}

/* ===== Unified site layout ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.site-shell {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 1rem 2.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-topbar {
    position: sticky;
    top: 0;
    z-index: 200;
    margin: 0 -1rem;
    padding: 0.65rem 1rem;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(51, 65, 85, 0.65);
}

.site-topbar-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 1180px;
    margin: 0 auto;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--text-main);
    transition: opacity 0.2s ease;
}

.site-brand:hover {
    opacity: 0.9;
}

.site-brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

.site-brand-text {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.site-brand-text span {
    color: var(--primary);
}

.site-menu-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-main);
    cursor: pointer;
    font-size: 1.1rem;
    position: relative;
    z-index: 210;
    flex-shrink: 0;
}

.site-menu-toggle i {
    pointer-events: none;
}

.site-nav-panel {
    display: flex;
    align-items: center;
}

.site-user-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.site-user-pill {
    color: var(--text-muted);
    font-size: 0.88rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--border);
}

.site-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-main);
    background: var(--card-bg);
    border: 1px solid var(--border);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-chip:hover {
    transform: translateY(-1px);
    border-color: var(--primary);
}

.site-chip-ghost {
    background: transparent;
}

.site-chip-premium {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: #fff;
}

.tool-hub {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin: 1.25rem 0 1.5rem;
}

.tool-hub-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    text-decoration: none;
    color: var(--text-main);
    background: rgba(30, 41, 59, 0.72);
    border: 1px solid rgba(51, 65, 85, 0.75);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.tool-hub-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.55);
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.35);
}

.tool-hub-card.is-active {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(30, 41, 59, 0.9));
    box-shadow: 0 8px 22px rgba(99, 102, 241, 0.25);
}

.tool-hub-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    color: #fff;
}

.tool-hub-icon-viewer { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.tool-hub-icon-image { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.tool-hub-icon-text { background: linear-gradient(135deg, #14b8a6, #0f766e); }
.tool-hub-icon-pricing { background: linear-gradient(135deg, #f59e0b, #d97706); }

.tool-hub-body {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    flex: 1;
}

.tool-hub-body strong {
    font-size: 0.92rem;
    line-height: 1.25;
}

.tool-hub-body small {
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.3;
}

.tool-hub-arrow {
    color: var(--text-muted);
    font-size: 0.75rem;
    opacity: 0.6;
}

.tool-hub-card--maintenance {
    opacity: 0.85;
    border-color: rgba(245, 158, 11, 0.35);
}

.tool-hub-card--maintenance:hover {
    border-color: rgba(245, 158, 11, 0.55);
}

.tool-hub-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.45);
    flex-shrink: 0;
}

.maintenance-notice {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.25rem 1.35rem;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(30, 41, 59, 0.85));
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.maintenance-notice-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.maintenance-notice-body h3 {
    margin: 0 0 0.5rem;
    color: #fde68a;
    font-size: 1.05rem;
}

.maintenance-notice-body p {
    margin: 0;
    color: #cbd5e1;
    line-height: 1.6;
}

.maintenance-notice-hint {
    margin-top: 0.65rem !important;
    font-size: 0.88rem;
    color: #94a3b8 !important;
}

.site-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.page-enter {
    animation: pageEnter 0.45s ease both;
}

@keyframes pageEnter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-intro {
    background: rgba(30, 41, 59, 0.65);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.35rem 1.5rem;
}

.page-intro h1 {
    margin: 0 0 0.4rem;
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.page-intro p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.65;
    max-width: 72ch;
}

.page-intro .steps-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.step-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #c7d2fe;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.28);
}

.card + .card {
    margin-top: 0;
}

.card.text-left {
    text-align: left;
}

.card.text-left p {
    text-align: left;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.form-grid label,
.field-label {
    display: block;
    font-size: 0.86rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
}

.form-grid input[type="number"],
.form-grid input[type="text"],
.form-grid select,
.form-input,
.form-select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-color);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
}

.form-grid input:focus,
.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.checkbox-row {
    display: flex;
    align-items: flex-end;
}

.checkbox-row label {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0;
    cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
    width: auto;
}

.two-col-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 1rem;
    align-items: start;
}

.site-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.site-footer-sub {
    margin-top: 0.35rem;
    font-size: 0.82rem;
}

.site-footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.85rem;
}

.site-footer-links a {
    color: #93c5fd;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.site-footer-links a:hover {
    text-decoration: underline;
}

.flash-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.flash-msg {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.92rem;
}

.flash-success { background: rgba(16, 185, 129, 0.15); border: 1px solid #10b981; color: #6ee7b7; }
.flash-error, .flash-danger { background: rgba(239, 68, 68, 0.15); border: 1px solid #ef4444; color: #fecaca; }
.flash-info { background: rgba(59, 130, 246, 0.15); border: 1px solid #3b82f6; color: #bfdbfe; }
.flash-warning { background: rgba(245, 158, 11, 0.15); border: 1px solid #f59e0b; color: #fde68a; }

/* Auth pages */
body.auth-page .site-main {
    align-items: center;
}

.auth-card {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 16px 40px rgba(2, 6, 23, 0.45);
}

.auth-card h1 {
    margin: 0 0 0.35rem;
    font-size: 1.75rem;
    text-align: center;
}

.auth-card .auth-sub {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.auth-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-size: 1.75rem;
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.35);
}

.auth-form .form-group {
    margin-bottom: 1rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
}

.auth-form input {
    width: 100%;
    padding: 0.8rem 0.9rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-color);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.auth-btn {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

.auth-links {
    text-align: center;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-links a {
    color: #93c5fd;
    font-weight: 600;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

.auth-alert {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.auth-alert.error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid #ef4444;
    color: #fecaca;
}

.auth-alert.success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid #10b981;
    color: #6ee7b7;
}

/* Pricing */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.pricing-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem;
    text-align: center;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.pricing-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.35);
}

.pricing-card.featured {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.35);
}

.pricing-card.premium {
    border-color: #10b981;
}

.pricing-price {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0.75rem 0;
    color: var(--text-main);
}

.pricing-validity {
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    text-align: left;
}

.pricing-features li {
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    color: var(--text-muted);
    font-size: 0.92rem;
}

.pricing-features li:last-child {
    border-bottom: none;
}

.btn-plan {
    width: 100%;
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.2s ease;
}

.btn-plan:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-plan-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}

.btn-plan-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}

.btn-plan:hover:not(:disabled) {
    transform: translateY(-1px);
}

.payment-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.payment-modal-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(2, 6, 23, 0.55);
}

.payment-modal-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
}

/* Text tool page helpers */
.symbol-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
    gap: 8px;
}

.symbol-btn {
    border: 1px solid var(--border);
    background: var(--bg-color);
    color: var(--text-main);
    border-radius: 9px;
    height: 42px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.18s ease;
}

.symbol-btn:hover {
    transform: translateY(-1px);
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.12);
}

.symbol-section-title {
    margin: 10px 0 8px;
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: #93c5fd;
}

.toolbar-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.tool-btn-sm {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    background: var(--bg-color);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
}

.tool-btn-sm:hover {
    border-color: var(--primary);
    color: var(--text-main);
}

.tip-box {
    margin-top: 10px;
    font-size: 0.85rem;
    color: #93c5fd;
    background: rgba(30, 58, 138, 0.2);
    border: 1px solid rgba(96, 165, 250, 0.24);
    border-radius: 10px;
    padding: 10px;
}

@media (max-width: 1024px) {
    .tool-hub {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .site-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
    }

    .site-brand {
        flex: 1 1 auto;
        min-width: 0;
        max-width: calc(100% - 52px);
    }

    .site-nav-panel {
        display: none;
        position: absolute;
        top: calc(100% + 4px);
        right: 1rem;
        left: 1rem;
        padding: 0.75rem;
        background: rgba(15, 23, 42, 0.98);
        border: 1px solid var(--border);
        border-radius: 14px;
        box-shadow: 0 16px 36px rgba(2, 6, 23, 0.5);
    }

    .site-nav-panel.is-open {
        display: block;
    }

    .site-topbar-inner {
        position: relative;
        flex-wrap: wrap;
    }

    .site-user-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .site-chip {
        justify-content: center;
    }

    .tool-hub {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .tool-hub-card {
        padding: 0.75rem 0.85rem;
    }

    .two-col-layout {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 1.35rem;
    }

    header {
        margin-bottom: 1.5rem;
    }
}

@media (max-width: 480px) {
    .site-shell {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .page-intro {
        padding: 1rem;
    }

    .tool-hub-body strong {
        font-size: 0.88rem;
    }
}