/* ResultPubli - Uxerflow Edition (High-Fidelity) */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Uxerflow Palette */
    --bg-app: #F9FAFB;
    --bg-card: #FFFFFF;
    --bg-hover: #F3F4F6;

    /* Purple/Violet Accents from Reference */
    --primary: #A855F7;
    --primary-dark: #6B21A8;
    --primary-gradient: linear-gradient(135deg, #A855F7 0%, #6B21A8 100%);

    /* Text */
    --text-main: #111827;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;

    /* Borders & Shadows */
    --border-soft: rgba(0, 0, 0, 0.04);
    --shadow-subtle: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-card: 0 10px 40px -10px rgba(0, 0, 0, 0.03);
    --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.04), 0 10px 10px -5px rgba(0, 0, 0, 0.02);

    /* Layout */
    --sidebar-width: 64px;
    --radius-lg: 24px;
    --radius-md: 16px;

    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-stagger: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Utility helpers */
.hidden { display: none; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ── Sidebar (Slim & Minimal) ──────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
    z-index: 50;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.01);
}

.sidebar:hover {
    width: 220px;
}

.sidebar-logo {
    margin-bottom: 40px;
    padding: 0 16px;
}

.sidebar-logo img {
    width: 32px;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.05));
}

.sidebar nav {
    flex: 1;
    width: 100%;
}

.sidebar nav ul {
    list-style: none;
    width: 100%;
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-smooth);
    overflow: hidden;
    white-space: nowrap;
}

.sidebar nav a svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar nav a .nav-label {
    margin-left: 16px;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.2s, transform 0.2s;
}

.sidebar:hover .nav-label {
    opacity: 1;
    transform: translateX(0);
}

.sidebar nav a:hover {
    background-color: var(--bg-hover);
    color: var(--text-main);
}

.sidebar nav a.active {
    background-color: var(--bg-hover);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-bottom {
    padding: 0 12px 32px 12px;
    /* Added bottom padding for UX spacing */
    width: 100%;
}

.sidebar-bottom a {
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-smooth);
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-bottom a svg {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px;
    flex-shrink: 0;
}

.sidebar-bottom a .nav-label {
    margin-left: 16px;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.2s, transform 0.2s;
}

.sidebar:hover .sidebar-bottom .nav-label {
    opacity: 1;
    transform: translateX(0);
}

/* ── Main Canvas ───────────────────────────────────────────────────────────── */
.main-canvas {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px 24px 24px 0;
    overflow: hidden;
}

.central-card {
    flex: 1;
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center horizontally */
    position: relative;
    overflow-y: auto;
    scroll-behavior: smooth;
    width: 100%;
}

/* ── Header ── */
.panel-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    z-index: 10;
}

.topbar-model {
    background: var(--bg-hover);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    border: 1px solid var(--border-soft);
}

.topbar-model svg {
    width: 14px;
    height: 14px;
    fill: var(--primary);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
}

.btn-icon:hover {
    background: var(--bg-hover);
    color: var(--text-main);
}

.btn-pill {
    padding: 8px 20px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-pill-dark {
    background-color: var(--text-main);
    color: #fff;
    border: none;
}

.btn-pill-dark:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ── Dashboard Layout ── */
.dashboard-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.dashboard-ctas {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 60px auto;
}

.gemini-star-wrap {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

.gemini-symbol {
    width: 72px;
    /* Balanced size */
    height: 72px;
    /* Flat design - No animations or shadows as requested */
}

/* ── Login Page (Uxerflow Style) ─────────────────────────────────────────── */
.login-page {
    background-color: #0A0A0B;
    /* Deep dark for login */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    min-height: 100vh;
    width: 100vw;
}

.login-container {
    width: 100%;
    max-width: 440px;
    text-align: center;
    padding: 20px;
    animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.login-branding h1 {
    font-size: 2.5rem;
    color: #FFFFFF;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.login-branding .highlight {
    color: var(--primary);
}

.login-branding p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 40px;
}

.login-card {
    background: #121214;
    padding: 40px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    margin-bottom: 30px;
}

.login-card h2 {
    color: #FFFFFF;
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.login-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 32px;
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    color: #000000;
    text-decoration: none;
    padding: 14px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.btn-google:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

.error-banner {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    padding: 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-bottom: 24px;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.login-footer {
    color: #4B4B4B;
    font-size: 0.8rem;
    margin-top: 20px;
}

.greeting-area {
    text-align: center;
    margin-bottom: 40px;
}

.greeting-area h1 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}

.greeting-area p {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.highlight-purple {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ── Central CTAs ── */
.dashboard-ctas {
    display: flex;
    justify-content: center;
    gap: 16px;
    width: 100%;
    max-width: 500px;
    margin-bottom: 60px;
}

.btn-hero {
    flex: 1;
    padding: 16px 24px;
    border-radius: 18px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.btn-hero-primary {
    background: var(--text-main);
    color: white;
}

.btn-hero-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn-hero-secondary {
    background: white;
    color: var(--text-main);
}

.btn-hero-secondary:hover {
    background: var(--bg-hover);
}

.admin-drive-link {
    width: 100%;
    margin-top: 12px;
    text-decoration: none;
}

.admin-drive-link[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Staggered Cards ── */
.trends-toolbar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.trends-toolbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.trends-header {
    width: auto;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0;
    text-align: left;
    white-space: nowrap;
}

.trends-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.trends-search input {
    width: 240px;
    max-width: 100%;
    padding: 9px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: var(--bg-hover);
    font-family: inherit;
    font-size: 0.82rem;
    color: var(--text-main);
    outline: none;
}

.trends-search input:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.btn-trend-toolbar {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
}

.trend-search-status {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    min-width: 56px;
    text-align: right;
}

.btn-refresh-trends {
    border: 1px solid var(--border-soft);
    background: var(--bg-card);
    color: var(--text-main);
}

.btn-refresh-trends:hover {
    background: var(--bg-hover);
}

.btn-refresh-trends:disabled {
    opacity: 0.65;
    cursor: progress;
}

.trends-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    width: 100%;
}

.dashboard-feedback-cta-wrap {
    width: 100%;
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.dashboard-feedback-trigger {
    border: 1px solid var(--border-soft);
    background: transparent;
    color: var(--text-secondary);
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.dashboard-feedback-trigger:hover {
    background: var(--bg-hover);
    color: var(--text-main);
}

.product-feedback-panel {
    width: min(720px, 100%);
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    box-shadow: var(--shadow-subtle);
    padding: 14px;
}

.product-feedback-panel p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.product-feedback-panel textarea {
    width: 100%;
    min-height: 120px;
    resize: vertical;
}

.product-feedback-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.product-feedback-btn {
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    background: var(--bg-card);
    color: var(--text-main);
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.product-feedback-btn.primary {
    background: var(--text-main);
    color: #fff;
    border-color: transparent;
}

.product-feedback-status {
    margin-left: auto;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.trend-card {
    background: var(--bg-hover);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 260px;
    /* Fixed height for consistency */
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    opacity: 0;
    transform: translateY(20px);
    position: relative;
    overflow: hidden;
}

.trend-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.trend-card:hover {
    background: white;
    border-color: var(--border-soft);
    box-shadow: var(--shadow-float);
    transform: translateY(-8px);
}

.trend-card.trend-card-match {
    border-color: rgba(168, 85, 247, 0.35);
}

.trend-card.trend-card-focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.14), var(--shadow-float);
    transform: translateY(-4px);
}

.trend-card .actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    width: 100%;
    align-items: center;
    /* Keep buttons from overflowing their container on small widths */
    min-width: 0;
}

.btn-trend {
    flex: 1 1 0;
    min-width: 0; /* allow flex items to shrink correctly */
    padding: 10px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.btn-trend-primary {
    background: var(--primary);
    color: white;
}

.btn-trend-secondary {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-soft);
}

.btn-trend:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.trend-card .title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-main);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    /* Allow more lines but keep it clean */
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 5.8em;
    /* Approximate 4 lines height */
}

/* ── Tab Content Container ── */
.tab-pane {
    display: none;
    padding: 40px;
}

.tab-pane.active {
    display: block;
}

.dashboard-container.tab-pane.active {
    display: flex;
}

/* ── Form Styling ── */
.form-card {
    max-width: 800px;
    margin: 0 auto;
}

.form-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.form-subtitle {
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.input-group {
    margin-bottom: 24px;
}

.input-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

input[type="text"],
select,
textarea {
    width: 100%;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    background: var(--bg-hover);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition-smooth);
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.1);
}

.selected-trend-context {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid rgba(168, 85, 247, 0.16);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(255, 255, 255, 0.95));
    flex-wrap: wrap;
}

.selected-trend-context.hidden {
    display: none;
}

.selected-trend-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.selected-trend-context a {
    color: var(--primary-dark);
    font-weight: 600;
    text-decoration: none;
    word-break: break-word;
}

.selected-trend-context a:hover {
    text-decoration: underline;
}

.selected-trend-clear {
    margin-left: auto;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.selected-trend-clear:hover {
    color: var(--primary-dark);
}

.tools-page {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

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

.tool-link-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    min-height: 220px;
    padding: 28px;
    border-radius: 28px;
    text-decoration: none;
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, rgba(168, 85, 247, 0.14), transparent 38%),
        linear-gradient(145deg, #FFFFFF 0%, #FAF6FF 100%);
    border: 1px solid rgba(168, 85, 247, 0.12);
    box-shadow: var(--shadow-card);
    transition: var(--transition-smooth);
}

.tool-link-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-float);
    border-color: rgba(168, 85, 247, 0.22);
}

.tool-link-card .tool-card-icon {
    margin-bottom: 0;
}

.tool-link-card span {
    font-size: 1.12rem;
    font-weight: 700;
    line-height: 1.4;
}

.tools-header {
    max-width: 760px;
}

.tools-kicker {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(168, 85, 247, 0.1);
    color: var(--primary-dark);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.tools-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-main);
}

.tools-header p {
    max-width: 640px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.tool-detail-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.tool-detail-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.tool-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--text-main);
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    font-size: 0.88rem;
    font-weight: 700;
    transition: var(--transition-smooth);
}

.tool-back-link:hover {
    background: var(--bg-hover);
}

.tool-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tool-switcher-link {
    padding: 10px 16px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--border-soft);
    font-size: 0.84rem;
    font-weight: 700;
    transition: var(--transition-smooth);
}

.tool-switcher-link:hover,
.tool-switcher-link.active {
    color: var(--text-main);
    border-color: rgba(168, 85, 247, 0.22);
    box-shadow: 0 10px 22px -18px rgba(17, 24, 39, 0.3);
}

.tool-switcher-link.active {
    background: rgba(168, 85, 247, 0.1);
}

.tool-card {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(168, 85, 247, 0.14), transparent 38%),
        linear-gradient(145deg, #FFFFFF 0%, #FAF6FF 100%);
    border: 1px solid rgba(168, 85, 247, 0.12);
    border-radius: 28px;
    box-shadow: var(--shadow-card);
    padding: 36px;
}

.tool-card > * {
    position: relative;
    z-index: 1;
}

.tool-card::after {
    content: "";
    position: absolute;
    inset: auto -40px -80px auto;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.15), transparent 72%);
    pointer-events: none;
}

.tool-focus-card {
    padding: 42px;
    border-radius: 34px;
}

.tool-focus-card .tool-card-icon {
    margin-bottom: 0;
}

.tool-focus-hero {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 18px;
}

.tool-focus-copy {
    max-width: 660px;
}

.tool-card-icon {
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    background: #FFFFFF;
    border: 1px solid rgba(17, 24, 39, 0.06);
    box-shadow: 0 18px 34px -24px rgba(17, 24, 39, 0.4);
    margin-bottom: 22px;
}

.tool-card-icon svg {
    width: 64px;
    height: 64px;
}

.tool-card-copy {
    max-width: 560px;
}

.tool-focus-copy h3,
.tool-card-copy h3 {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
}

.tool-focus-copy p,
.tool-card-copy p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 28px;
}

.tool-focus-copy p {
    margin-bottom: 0;
}

.tool-focus-form {
    width: 100%;
}

.tool-focus-form-split {
    display: grid;
    grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
    gap: 20px;
}

.tool-focus-form .input-group:last-child {
    margin-bottom: 0;
}

.tool-focus-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.tool-focus-hint {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.7;
}

.qr-tool-card textarea,
.whatsapp-tool-card textarea {
    min-height: 120px;
    resize: vertical;
}

.qr-generate-btn {
    width: min(320px, 100%);
}

.tool-inline-status {
    min-height: 22px;
    margin-top: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.tool-inline-status.success {
    color: #047857;
}

.tool-inline-status.error {
    color: #B91C1C;
}

.whatsapp-icon {
    background: linear-gradient(145deg, #F5FFF8 0%, #FFFFFF 100%);
    color: #25D366;
}

.text-correction-icon {
    background: linear-gradient(145deg, #F3F4FF 0%, #FFFFFF 100%);
    color: #4F46E5;
}

.whatsapp-result {
    margin-top: 18px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(17, 24, 39, 0.06);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.whatsapp-result.hidden {
    display: none;
}

.color-picker-card {
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.12), transparent 34%),
        radial-gradient(circle at bottom right, rgba(245, 158, 11, 0.12), transparent 32%),
        linear-gradient(145deg, #FFFFFF 0%, #F8FBFF 100%);
}

.color-picker-icon {
    background: linear-gradient(145deg, #F7FAFF 0%, #FFFFFF 100%);
}

.text-correction-card textarea {
    min-height: 240px;
    resize: vertical;
}

.text-correction-summary {
    margin-top: 10px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(79, 70, 229, 0.08);
    border: 1px solid rgba(79, 70, 229, 0.12);
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
}

.text-correction-summary.hidden {
    display: none;
}

.text-correction-summary strong {
    font-size: 0.98rem;
    color: var(--text-main);
}

.text-correction-summary span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.text-correction-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
}

.text-correction-results.hidden {
    display: none;
}

.text-correction-item {
    padding: 20px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(17, 24, 39, 0.06);
    box-shadow: 0 14px 26px -24px rgba(17, 24, 39, 0.3);
}

.text-correction-item-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.text-correction-category,
.text-correction-rule {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.text-correction-category {
    color: #4338CA;
}

.text-correction-rule {
    color: var(--text-muted);
}

.text-correction-message {
    color: var(--text-main);
    font-weight: 600;
    line-height: 1.6;
    margin-bottom: 12px;
}

.text-correction-context {
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 14px;
}

.text-correction-context mark {
    background: rgba(245, 158, 11, 0.22);
    color: var(--text-main);
    padding: 2px 4px;
    border-radius: 6px;
}

.text-correction-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.text-correction-suggestion {
    border-color: rgba(79, 70, 229, 0.14);
}

.text-correction-no-suggestion {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.color-picker-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.color-picker-toolbar-hint {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.6;
}

.color-picker-empty {
    margin-top: 10px;
    border-radius: 26px;
    border: 1.5px dashed rgba(17, 24, 39, 0.14);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 247, 250, 0.96));
    padding: 38px 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.color-picker-empty:hover {
    border-color: rgba(59, 130, 246, 0.24);
    background: #FFFFFF;
}

.color-picker-empty.hidden {
    display: none;
}

.color-picker-empty-icon {
    width: 68px;
    height: 68px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.08);
    color: #2563EB;
}

.color-picker-empty-icon svg {
    width: 28px;
    height: 28px;
}

.color-picker-empty strong {
    font-size: 1.05rem;
    color: var(--text-main);
}

.color-picker-empty p {
    max-width: 560px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.color-picker-stage {
    margin-top: 12px;
    padding: 16px;
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(244, 247, 250, 0.94));
    border: 1px solid rgba(17, 24, 39, 0.06);
}

.color-picker-stage.hidden {
    display: none;
}

.color-picker-image-shell {
    position: relative;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 24px 38px -28px rgba(17, 24, 39, 0.35);
    touch-action: none;
    background: #FFFFFF;
}

.color-picker-image-shell img {
    display: block;
    max-width: 100%;
    max-height: 620px;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
}

.color-picker-markers {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.color-picker-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 3px solid rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 24px -14px rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(6px);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    pointer-events: auto;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.color-picker-marker:active {
    cursor: grabbing;
    transform: translate(-50%, -50%) scale(1.06);
    box-shadow: 0 18px 28px -14px rgba(17, 24, 39, 0.6);
}

.color-picker-marker span {
    font-size: 1.3rem;
    line-height: 1;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(17, 24, 39, 0.28);
}

.color-picker-swatches {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.color-picker-swatches.hidden {
    display: none;
}

.color-swatch-card {
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(17, 24, 39, 0.07);
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 14px 26px -24px rgba(17, 24, 39, 0.3);
}

.color-swatch-preview {
    height: 108px;
}

.color-swatch-meta {
    padding: 14px 14px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.color-swatch-label {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.color-swatch-copy {
    padding: 9px 12px;
    font-size: 0.78rem;
}

.color-swatch-hex {
    padding: 0 14px 16px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 0.04em;
}

.tool-output-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.tool-output-row input[readonly] {
    background: #FFFFFF;
    color: var(--text-main);
    font-size: 0.9rem;
}

.tool-output-btn {
    flex-shrink: 0;
    border: 1px solid var(--border-soft);
    background: var(--bg-card);
    color: var(--text-main);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.tool-output-btn:hover {
    background: var(--bg-hover);
}

.qr-modal-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(17, 24, 39, 0.42);
    backdrop-filter: blur(6px);
    z-index: 1300;
}

.qr-modal-overlay.hidden {
    display: none;
}

.qr-modal {
    width: min(520px, 100%);
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 28px;
    box-shadow: 0 28px 60px -20px rgba(17, 24, 39, 0.35);
    padding: 26px;
}

.qr-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.qr-modal-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.qr-modal-header p {
    color: var(--text-secondary);
    line-height: 1.5;
}

.qr-modal-close {
    border: 1px solid var(--border-soft);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 10px 16px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.qr-modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-main);
}

.qr-preview-frame {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 344px;
    background:
        linear-gradient(180deg, rgba(249, 250, 251, 0.92), rgba(243, 244, 246, 0.95));
    border: 1px solid rgba(17, 24, 39, 0.05);
    border-radius: 22px;
    margin: 24px 0;
    padding: 24px;
}

.qr-preview-canvas {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 18px;
    background: #FFFFFF;
    box-shadow: 0 20px 32px -24px rgba(17, 24, 39, 0.35);
    image-rendering: pixelated;
}

.qr-modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.qr-download-btn {
    min-width: 150px;
}

.qr-download-btn-secondary {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-soft);
}

.qr-download-btn-secondary:hover {
    background: var(--bg-hover);
}

/* ── Animations Reference ── */
.stagger-1 {
    transition-delay: 0.1s;
}

.stagger-2 {
    transition-delay: 0.2s;
}

.stagger-3 {
    transition-delay: 0.3s;
}

.stagger-4 {
    transition-delay: 0.4s;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .trends-toolbar {
        align-items: flex-start;
    }

    .trends-toolbar-left {
        flex-direction: column;
        align-items: flex-start;
    }

    .trends-search input {
        width: min(320px, 100%);
    }

    .trends-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tools-directory-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tool-focus-form-split {
        grid-template-columns: 1fr;
    }

    .color-picker-swatches {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .trends-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .trends-toolbar-left {
        width: 100%;
    }

    .trends-header {
        white-space: normal;
    }

    .trends-search {
        width: 100%;
    }

    .trends-search input {
        width: 100%;
        flex: 1;
    }

    .btn-refresh-trends {
        width: 100%;
    }

    .trends-grid {
        grid-template-columns: 1fr;
    }

    .trend-card {
        height: auto;
        padding: 18px;
    }

    .trend-card .actions {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .btn-trend {
        width: 100%;
        flex: 1 1 auto;
    }

    .tab-pane {
        padding: 24px;
    }

    .tool-card {
        padding: 24px;
    }

    .tool-link-card {
        min-height: 0;
    }

    .tools-header h2 {
        font-size: 1.65rem;
    }

    .tool-detail-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .tool-switcher {
        width: 100%;
    }

    .tool-switcher-link {
        flex: 1 1 auto;
        text-align: center;
    }

    .tool-focus-card {
        padding: 28px;
    }

    .tool-focus-hero {
        flex-direction: column;
    }

    .tool-focus-actions {
        align-items: stretch;
    }

    .tool-focus-actions .btn-pill {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .qr-modal {
        padding: 20px;
    }

    .qr-modal-header {
        flex-direction: column;
    }

    .qr-modal-close {
        width: 100%;
    }

    .qr-preview-frame {
        min-height: 280px;
        padding: 18px;
    }

    .qr-modal-actions {
        flex-direction: column;
    }

    .qr-download-btn {
        width: 100%;
    }

    .tool-output-row {
        flex-direction: column;
        align-items: stretch;
    }

    .tool-output-btn {
        width: 100%;
    }

    .text-correction-item {
        padding: 18px;
    }

    .text-correction-suggestions {
        flex-direction: column;
    }

    .text-correction-suggestion {
        width: 100%;
    }

    .color-picker-toolbar {
        align-items: stretch;
    }

    .color-picker-toolbar .btn-pill {
        width: 100%;
    }

    .tools-directory-grid {
        grid-template-columns: 1fr;
    }

    .color-picker-empty {
        padding: 28px 18px;
    }

    .color-picker-stage {
        padding: 10px;
    }

    .color-picker-marker {
        width: 36px;
        height: 36px;
    }

    .color-picker-swatches {
        grid-template-columns: 1fr;
    }

    .color-swatch-preview {
        height: 84px;
    }

    .color-swatch-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .color-swatch-copy {
        width: 100%;
    }
}
