/* Internship Autopilot — LinkedIn import, matches, one-click apply */

.ap-input-card {
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    max-width: 820px;
    margin: 0 auto;
    border-radius: 20px;
}

/* Info note (shown when someone arrives expecting URL import) */
.ap-note {
    padding: var(--space-3) var(--space-4);
    border-radius: 12px;
    background: rgba(245, 178, 7, 0.12);
    border: 1px solid rgba(245, 178, 7, 0.35);
    font-size: var(--fs-sm, 0.9rem);
    line-height: 1.5;
}

/* Two free import methods */
.ap-methods { display: flex; flex-direction: column; gap: var(--space-3); }

.ap-method {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    padding: var(--space-4);
    border-radius: 16px;
    border: 1.5px solid rgba(10, 102, 194, 0.2);
    background: var(--color-surface, #fff);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.ap-upload { cursor: pointer; }
.ap-flash { animation: apFlash 2.1s ease; }
@keyframes apFlash {
    0%, 100% { border-color: rgba(10, 102, 194, 0.2); box-shadow: none; }
    15%, 60% { border-color: #0a66c2; box-shadow: 0 0 0 4px rgba(10, 102, 194, 0.18); }
}
.ap-upload:hover,
.ap-upload.is-dragover {
    border-color: #0a66c2;
    box-shadow: 0 10px 28px -16px rgba(10, 102, 194, 0.5);
    background: rgba(10, 102, 194, 0.04);
}

.ap-method-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(10, 102, 194, 0.1);
    color: #0a66c2;
}

.ap-method-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ap-method-main--full { flex: 1; width: 100%; }
.ap-method-title { font-weight: 700; font-size: var(--fs-md, 1rem); display: flex; align-items: center; gap: 8px; }
.ap-method-sub { font-size: var(--fs-sm, 0.88rem); color: var(--color-text-muted, #6b6455); line-height: 1.5; }

.ap-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #15803d;
    background: rgba(34, 197, 94, 0.15);
    padding: 2px 8px;
    border-radius: 999px;
}

/* One-click LinkedIn bookmarklet */
.ap-bookmarklet { border-color: rgba(10, 102, 194, 0.3); background: rgba(10, 102, 194, 0.04); }
.ap-bm-steps {
    margin: 8px 0 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: var(--fs-sm, 0.9rem);
}
.ap-bm-steps li { line-height: 1.6; }
.ap-bm-btn {
    display: inline-block;
    cursor: grab;
    background: #0a66c2;
    color: #fff !important;
    text-decoration: none;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: var(--fs-sm, 0.88rem);
    box-shadow: 0 4px 12px -4px rgba(10, 102, 194, 0.5);
    user-select: none;
    white-space: nowrap;
    vertical-align: middle;
}
.ap-bm-btn:hover { background: #0956a8; }
[data-theme="dark"] .ap-bookmarklet { background: rgba(59, 130, 246, 0.06); }

.ap-upload-name {
    margin-left: auto;
    align-self: center;
    font-size: var(--fs-sm, 0.85rem);
    color: #0a66c2;
    font-weight: 600;
    max-width: 40%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ap-method textarea {
    width: 100%;
    resize: vertical;
    min-height: 130px;
    margin-top: 4px;
    padding: var(--space-3);
    border-radius: 12px;
    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.12));
    background: transparent;
    color: var(--color-text, inherit);
    font: inherit;
    line-height: 1.6;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ap-method textarea:focus {
    outline: none;
    border-color: #0a66c2;
    box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.12);
}

.ap-input-actions { display: flex; justify-content: center; }
.ap-input-actions .btn { min-width: 220px; }

[data-theme="dark"] .ap-method {
    background: rgba(28, 28, 34, 0.5);
    border-color: rgba(59, 130, 246, 0.3);
}
[data-theme="dark"] .ap-method-icon { background: rgba(59, 130, 246, 0.18); color: #4aa3ff; }
[data-theme="dark"] .ap-upload-name { color: #4aa3ff; }
[data-theme="dark"] .ap-method textarea { border-color: rgba(255, 255, 255, 0.14); }

/* Import-from-link input row (inside the first method card) */
.ap-linkbar { display: flex; gap: 8px; margin-top: 2px; }
.ap-linkbar input {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid var(--color-border, rgba(0, 0, 0, 0.12));
    background: transparent;
    color: var(--color-text, inherit);
    font: inherit;
    font-size: var(--fs-md, 1rem);
}
.ap-linkbar input:focus {
    outline: none;
    border-color: #0a66c2;
    box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.12);
}
.ap-linkbar .btn { flex-shrink: 0; border-radius: 10px; }
[data-theme="dark"] .ap-linkbar input { border-color: rgba(255, 255, 255, 0.14); }
@media (max-width: 640px) {
    .ap-linkbar { flex-direction: column; }
    .ap-linkbar .btn { width: 100%; }
}

.ap-hint { font-size: var(--fs-xs); margin: 0; }

/* Status banner */
.ap-status {
    max-width: 780px;
    margin: var(--space-4) auto 0;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md, 12px);
    font-size: var(--fs-sm);
    text-align: center;
}
.ap-status--info    { background: rgba(59,130,246,.10); color: #1d4ed8; }
.ap-status--success { background: rgba(34,197,94,.12);  color: #15803d; }
.ap-status--error   { background: rgba(239,68,68,.12);  color: #b91c1c; }

/* Results */
.ap-results { max-width: 860px; margin: var(--space-6) auto 0; }

.ap-profile-summary {
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3) var(--space-4);
}
.ap-profile-name { font-weight: 700; font-size: var(--fs-lg); }
.ap-profile-headline { color: var(--color-text-muted, #666); font-size: var(--fs-sm); }

.ap-results-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}
.ap-results-head .count { font-weight: 600; }
.ap-results-actions { display: flex; align-items: center; gap: var(--space-4); }
.ap-selectall { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); cursor: pointer; }

.ap-list { display: flex; flex-direction: column; gap: var(--space-3); }

.ap-match {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4);
    align-items: flex-start;
    transition: opacity .2s ease;
}
.ap-match.is-applied { opacity: .55; }
.ap-check { padding-top: 4px; }
.ap-match-body { flex: 1; min-width: 0; }

.ap-match-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-3);
}
.ap-match-top h3 { margin: 0; font-size: var(--fs-md); }
.ap-match-top .company-line { color: var(--color-text-muted, #666); font-size: var(--fs-sm); }

.ap-score {
    flex-shrink: 0;
    font-weight: 700;
    font-size: var(--fs-sm);
    padding: 4px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(34,197,94,.18), rgba(59,130,246,.18));
    color: var(--color-text, #1a1608);
}

/* Source badge (Rjobs.net vs web) + external apply link */
.ap-src {
    display: inline-block;
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 2px 7px;
    border-radius: 999px;
    margin-left: 6px;
    vertical-align: middle;
}
.ap-src--own { color: #b45309; background: rgba(245, 178, 7, 0.15); }
.ap-src--web { color: #1d4ed8; background: rgba(59, 130, 246, 0.14); }
[data-theme="dark"] .ap-src--web { color: #93c5fd; }

.ap-ext-apply {
    margin-left: auto;
    font-weight: 600;
    color: #0a66c2;
    text-decoration: none;
    white-space: nowrap;
}
.ap-ext-apply:hover { text-decoration: underline; }
[data-theme="dark"] .ap-ext-apply { color: #4aa3ff; }

.ap-check--ext { width: 18px; flex-shrink: 0; }
.ap-match--ext { border-left: 3px solid rgba(59, 130, 246, 0.35); }

/* Browse-the-web internship search links */
.ap-weblinks {
    margin-top: var(--space-5);
    padding: var(--space-4);
    border-radius: 16px;
    border: 1px dashed rgba(10, 102, 194, 0.3);
    background: rgba(10, 102, 194, 0.04);
}
.ap-weblinks-title { font-weight: 700; margin-bottom: var(--space-3); }
.ap-weblinks-links { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.ap-weblink {
    display: inline-flex;
    align-items: center;
    padding: 9px 16px;
    border-radius: 999px;
    background: var(--color-surface, #fff);
    border: 1px solid rgba(10, 102, 194, 0.25);
    color: #0a66c2;
    font-weight: 600;
    font-size: var(--fs-sm, 0.9rem);
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease;
}
.ap-weblink:hover { background: rgba(10, 102, 194, 0.08); transform: translateY(-1px); }
[data-theme="dark"] .ap-weblinks { background: rgba(59, 130, 246, 0.06); border-color: rgba(59, 130, 246, 0.35); }
[data-theme="dark"] .ap-weblink { background: rgba(28, 28, 34, 0.6); color: #4aa3ff; border-color: rgba(59, 130, 246, 0.35); }

@media (max-width: 640px) {
    .ap-method { flex-direction: column; }
    .ap-upload-name { margin-left: 0; max-width: 100%; }
    .ap-input-actions .btn { width: 100%; }
}

/* Landing-page hero LinkedIn bar — premium pill */
.ap-herobar {
    max-width: 640px;
    margin: var(--space-5) auto var(--space-4);
    width: 100%;
    display: block;
    text-decoration: none;
    color: inherit;
}

.ap-herobar-text {
    flex: 1;
    min-width: 0;
    text-align: left;
    font-size: var(--fs-md, 1rem);
    color: var(--color-text, #1a1608);
    padding: 12px 4px;
}
.ap-herobar-text b { color: #0a66c2; }
[data-theme="dark"] .ap-herobar-text { color: var(--color-text, #f2efe6); }
[data-theme="dark"] .ap-herobar-text b { color: #4aa3ff; }

.ap-herobar-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px 6px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1.5px solid rgba(10, 102, 194, 0.28);
    box-shadow: 0 14px 34px -12px rgba(10, 102, 194, 0.38), 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.ap-herobar-inner:hover { transform: translateY(-1px); }
.ap-herobar-inner:focus-within {
    border-color: #0a66c2;
    box-shadow: 0 18px 44px -12px rgba(10, 102, 194, 0.5), 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ap-herobar-icon {
    display: flex;
    align-items: center;
    color: #0a66c2;
    flex-shrink: 0;
}

.ap-herobar-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    padding: 13px 4px;
    font: inherit;
    font-size: var(--fs-md, 1rem);
    color: var(--color-text, #1a1608);
}
.ap-herobar-input::placeholder { color: var(--color-text-faint, #9a9382); }

.ap-herobar-btn {
    flex-shrink: 0;
    white-space: nowrap;
    border-radius: 999px !important;
    padding: 12px 24px;
}

.ap-herobar-hint {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: var(--fs-xs, 0.8rem);
    color: var(--color-text-muted, #6b6455);
    letter-spacing: 0.01em;
}

/* Dark theme */
[data-theme="dark"] .ap-herobar-inner {
    background: rgba(28, 28, 34, 0.62);
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 16px 40px -14px rgba(0, 0, 0, 0.6);
}
[data-theme="dark"] .ap-herobar-icon { color: #4aa3ff; }
[data-theme="dark"] .ap-herobar-input { color: var(--color-text, #f2efe6); }

/* Mobile: stack into a card */
@media (max-width: 560px) {
    .ap-herobar-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
        border-radius: 18px;
    }
    .ap-herobar-icon { display: none; }
    .ap-herobar-text { text-align: center; padding: 4px; }
    .ap-herobar-input {
        text-align: center;
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 12px;
        padding: 12px;
    }
    [data-theme="dark"] .ap-herobar-input { border-color: rgba(255, 255, 255, 0.14); }
    .ap-herobar-btn { width: 100%; border-radius: 12px !important; }
}

/* =========================================================================
   CLEAN / LIGHT / PROFESSIONAL THEME — scoped to the Autopilot page (.ap-page)
   Overrides the older styles by specificity; landing hero (.ap-herobar) intact.
   ========================================================================= */
.ap-page {
    --ap-accent: #2563eb;
    --ap-accent-600: #1d4ed8;
    --ap-weak: rgba(37, 99, 235, 0.08);
    --ap-ink: #0f172a;
    --ap-muted: #64748b;
    --ap-line: #e6e8ee;
    --ap-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 14px 34px -18px rgba(16, 24, 40, 0.18);
}

/* Calm the busy global background — only on the standalone tool page */
body:has(.ap-standalone) .blob-field,
body:has(.ap-standalone) .bg-noise,
body:has(.ap-standalone) .bg-mesh { display: none !important; }
body:has(.ap-standalone) { background: #f5f7fb; }

/* Layout + header */
.ap-page .container { max-width: 1200px; }
/* Import box + header stay a comfortable centered width; results go full width */
.ap-page .section-head, .ap-page .ap-input-card, .ap-page .ap-status { max-width: 680px; margin-left: auto; margin-right: auto; }
.ap-page .section-head { text-align: center; }
.ap-page .section-head .eyebrow {
    display: inline-block; color: var(--ap-accent); background: var(--ap-weak);
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    padding: 5px 12px; border-radius: 999px; margin-bottom: 14px;
}
.ap-page .section-head .eyebrow svg { display: none; }
.ap-page .section-head h2 { font-size: clamp(1.55rem, 3.4vw, 2.15rem); line-height: 1.2; color: var(--ap-ink); font-weight: 800; margin: 0 0 10px; }
.ap-page .section-head p { color: var(--ap-muted); font-size: 1rem; line-height: 1.6; max-width: 560px; margin: 0 auto; }
.ap-page .section-head strong { color: var(--ap-ink); }

/* Card */
.ap-page .ap-input-card {
    background: #fff; border: 1px solid var(--ap-line); border-radius: 20px;
    box-shadow: var(--ap-shadow); padding: clamp(18px, 3.5vw, 28px);
    display: flex; flex-direction: column; gap: 14px;
}

/* Method rows */
.ap-page .ap-methods { display: flex; flex-direction: column; gap: 12px; }
.ap-page .ap-method {
    display: flex; gap: 14px; align-items: flex-start; padding: 16px;
    border: 1px solid var(--ap-line); border-radius: 14px; background: #fff;
    box-shadow: none; transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.ap-page .ap-upload { cursor: pointer; }
.ap-page .ap-upload:hover,
.ap-page .ap-upload.is-dragover { border-color: var(--ap-accent); background: var(--ap-weak); }
.ap-page .ap-bookmarklet { background: #fafbff; border-color: #e2e8ff; }
.ap-page .ap-method-icon {
    flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--ap-weak); color: var(--ap-accent);
}
.ap-page .ap-method-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.ap-page .ap-method-title { font-weight: 700; font-size: 0.98rem; color: var(--ap-ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ap-page .ap-method-sub { font-size: 0.86rem; color: var(--ap-muted); line-height: 1.55; }
.ap-page .ap-method-sub strong { color: var(--ap-ink); }
.ap-page .ap-badge { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #0e7c3a; background: rgba(16, 185, 129, 0.12); padding: 2px 7px; border-radius: 999px; }

/* Link input */
.ap-page .ap-linkbar { display: flex; gap: 8px; margin-top: 4px; }
.ap-page .ap-linkbar input {
    flex: 1; min-width: 0; padding: 10px 14px; border-radius: 10px;
    border: 1px solid var(--ap-line); background: #fff; color: var(--ap-ink); font: inherit; font-size: 0.92rem;
}
.ap-page .ap-linkbar input:focus { outline: none; border-color: var(--ap-accent); box-shadow: 0 0 0 3px var(--ap-weak); }

/* Bookmarklet */
.ap-page .ap-bm-steps { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 0.86rem; color: var(--ap-muted); }
.ap-page .ap-bm-steps strong { color: var(--ap-ink); }
.ap-page .ap-bm-btn { display: inline-block; cursor: grab; background: var(--ap-accent); color: #fff !important; text-decoration: none; font-weight: 600; padding: 5px 12px; border-radius: 8px; font-size: 0.82rem; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1); user-select: none; white-space: nowrap; vertical-align: middle; }
.ap-page .ap-bm-btn:hover { background: var(--ap-accent-600); }

/* Upload filename + flash */
.ap-page .ap-upload-name { margin-left: auto; align-self: center; font-size: 0.84rem; color: var(--ap-accent); font-weight: 600; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-page .ap-flash { animation: apFlashClean 2s ease; }
@keyframes apFlashClean { 0%, 100% { border-color: var(--ap-line); box-shadow: none; } 20%, 60% { border-color: var(--ap-accent); box-shadow: 0 0 0 4px var(--ap-weak); } }

/* Textarea */
.ap-page .ap-method textarea {
    width: 100%; resize: vertical; min-height: 120px; margin-top: 4px; padding: 12px 14px;
    border-radius: 10px; border: 1px solid var(--ap-line); background: #fff; color: var(--ap-ink);
    font: inherit; line-height: 1.6; font-size: 0.92rem;
}
.ap-page .ap-method textarea:focus { outline: none; border-color: var(--ap-accent); box-shadow: 0 0 0 3px var(--ap-weak); }

/* Buttons */
.ap-page .btn-primary { background: var(--ap-accent); color: #fff; border: none; border-radius: 10px; font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1); transition: background 0.15s, transform 0.05s; }
.ap-page .btn-primary:hover { background: var(--ap-accent-600); }
.ap-page .btn-primary:active { transform: translateY(1px); }
.ap-page .ap-input-actions { display: flex; justify-content: center; margin-top: 4px; }
.ap-page .ap-input-actions .btn { min-width: 220px; padding: 12px 24px; font-size: 0.98rem; }
.ap-page .ap-hint { font-size: 0.78rem; color: var(--ap-muted); margin: 0; text-align: center; }

/* Status */
.ap-page .ap-status { max-width: 720px; margin: 16px auto 0; padding: 11px 16px; border-radius: 12px; font-size: 0.9rem; text-align: center; }
.ap-page .ap-status--info { background: var(--ap-weak); color: var(--ap-accent-600); }
.ap-page .ap-status--success { background: rgba(16, 185, 129, 0.12); color: #0e7c3a; }
.ap-page .ap-status--error { background: rgba(239, 68, 68, 0.1); color: #b42318; }

/* Results */
.ap-page .ap-results { margin-top: 26px; max-width: 100%; }
.ap-page .ap-profile-summary { background: #fff; border: 1px solid var(--ap-line); border-radius: 14px; box-shadow: var(--ap-shadow); padding: 16px 18px; margin-bottom: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.ap-page .ap-profile-name { font-weight: 700; color: var(--ap-ink); font-size: 1.02rem; }
.ap-page .ap-profile-headline { color: var(--ap-muted); font-size: 0.88rem; }
.ap-page .ap-results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.ap-page .ap-results-head .count { font-weight: 700; color: var(--ap-ink); }
.ap-page .ap-results-actions { display: flex; align-items: center; gap: 14px; }
.ap-page .ap-selectall { display: inline-flex; align-items: center; gap: 6px; font-size: 0.86rem; color: var(--ap-muted); cursor: pointer; }
.ap-page .ap-list { display: flex; flex-direction: column; gap: 10px; }
.ap-page .ap-match { display: flex; gap: 12px; padding: 16px; align-items: flex-start; background: #fff; border: 1px solid var(--ap-line); border-radius: 14px; box-shadow: none; transition: box-shadow 0.15s, border-color 0.15s; }
.ap-page .ap-match:hover { box-shadow: var(--ap-shadow); border-color: #d7dbe6; }
.ap-page .ap-match.is-applied { opacity: 0.55; }
.ap-page .ap-match--ext { border-left: 3px solid var(--ap-accent); }
.ap-page .ap-check { padding-top: 3px; }
.ap-page .ap-check--ext { width: 18px; flex-shrink: 0; }
.ap-page .ap-match-body { flex: 1; min-width: 0; }
.ap-page .ap-match-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ap-page .ap-match-top h3 { margin: 0; font-size: 0.98rem; }
.ap-page .ap-match-top h3 a { color: var(--ap-ink); text-decoration: none; }
.ap-page .ap-match-top h3 a:hover { color: var(--ap-accent); }
.ap-page .company-line { color: var(--ap-muted); font-size: 0.85rem; margin-top: 2px; }
.ap-page .ap-score { flex-shrink: 0; font-weight: 700; font-size: 0.8rem; padding: 4px 10px; border-radius: 999px; background: var(--ap-weak); color: var(--ap-accent-600); }
.ap-page .job-card-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 8px; font-size: 0.82rem; color: var(--ap-muted); align-items: center; }
.ap-page .job-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ap-page .job-tag { font-size: 0.74rem; background: #f1f4f9; color: #475569; padding: 3px 9px; border-radius: 6px; }
.ap-page .ap-src { display: inline-block; font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 7px; border-radius: 999px; margin-left: 6px; }
.ap-page .ap-src--own { color: #92600a; background: rgba(245, 178, 7, 0.14); }
.ap-page .ap-src--web { color: var(--ap-accent-600); background: var(--ap-weak); }
.ap-page .ap-ext-apply { margin-left: auto; font-weight: 600; color: var(--ap-accent); text-decoration: none; white-space: nowrap; }
.ap-page .ap-ext-apply:hover { text-decoration: underline; }

/* Empty state */
.ap-page .empty-state { text-align: center; padding: 30px 16px; }
.ap-page .empty-state svg { color: #cbd5e1; }
.ap-page .empty-state h3 { color: var(--ap-ink); margin: 8px 0 6px; }
.ap-page .empty-state p { color: var(--ap-muted); }

/* Browse-the-web */
.ap-page .ap-weblinks { margin-top: 22px; padding: 18px; border-radius: 14px; border: 1px solid var(--ap-line); background: #fff; box-shadow: var(--ap-shadow); max-width: 100%; }
.ap-page .ap-weblinks-title { font-weight: 700; color: var(--ap-ink); margin-bottom: 12px; }
.ap-page .ap-weblinks-links { display: flex; flex-wrap: wrap; gap: 10px; }
.ap-page .ap-weblink { display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 10px; background: #fff; border: 1px solid var(--ap-line); color: var(--ap-accent); font-weight: 600; font-size: 0.86rem; text-decoration: none; transition: background 0.15s, border-color 0.15s; }
.ap-page .ap-weblink:hover { background: var(--ap-weak); border-color: var(--ap-accent); }

/* Mobile */
@media (max-width: 560px) {
    .ap-page .ap-linkbar { flex-direction: column; }
    .ap-page .ap-linkbar input, .ap-page .ap-linkbar .btn { width: 100%; }
    .ap-page .ap-method { flex-direction: column; }
    .ap-page .ap-upload-name { margin-left: 0; max-width: 100%; }
    .ap-page .ap-input-actions .btn { width: 100%; }
}

/* ---- Minimal link-first layout + customize + 4-card grid ---- */
.ap-page .ap-linkbar--hero input { padding: 14px 16px; font-size: 1rem; }
.ap-page .ap-linkbar--hero .btn { padding: 14px 22px; font-size: 0.98rem; white-space: nowrap; }

.ap-page .ap-more-toggle {
    background: none; border: none; color: var(--ap-accent); font-weight: 600;
    font-size: 0.86rem; cursor: pointer; padding: 2px 0; align-self: center;
}
.ap-page .ap-more-toggle:hover { text-decoration: underline; }
.ap-page .ap-more { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--ap-line); padding-top: 14px; }
.ap-page .ap-bm-details summary { cursor: pointer; color: var(--ap-muted); font-size: 0.86rem; font-weight: 600; }
.ap-page .ap-bm-details[open] summary { color: var(--ap-ink); margin-bottom: 6px; }
.ap-page .ap-paste .btn { border-radius: 10px; padding: 9px 18px; font-size: 0.9rem; }

/* Customize bar */
.ap-page .ap-customize { display: flex; gap: 8px; margin-bottom: 16px; }
.ap-page .ap-customize input {
    flex: 1; min-width: 0; padding: 11px 14px; border-radius: 10px;
    border: 1px solid var(--ap-line); background: #fff; color: var(--ap-ink); font: inherit; font-size: 0.92rem;
}
.ap-page .ap-customize input:focus { outline: none; border-color: var(--ap-accent); box-shadow: 0 0 0 3px var(--ap-weak); }
.ap-page .ap-customize .btn { white-space: nowrap; }

/* 4-per-row grid of compact cards */
.ap-page .ap-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 1000px) { .ap-page .ap-list { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .ap-page .ap-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .ap-page .ap-list { grid-template-columns: 1fr; } }

.ap-page .ap-match { display: flex; flex-direction: column; gap: 8px; padding: 14px; height: 100%; }
.ap-page .ap-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ap-page .ap-match h3 { margin: 0; font-size: 0.92rem; line-height: 1.35; }
.ap-page .ap-match h3 a { color: var(--ap-ink); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ap-page .ap-match h3 a:hover { color: var(--ap-accent); }
.ap-page .ap-match .company-line { font-size: 0.8rem; color: var(--ap-muted); margin: 0; }
.ap-page .ap-card-foot { margin-top: auto; padding-top: 6px; }
.ap-page .ap-apply-btn { display: block; width: 100%; text-align: center; background: var(--ap-accent); color: #fff !important; text-decoration: none; font-weight: 600; font-size: 0.85rem; padding: 8px 12px; border-radius: 8px; transition: background 0.15s; }
.ap-page .ap-apply-btn:hover { background: var(--ap-accent-600); }
.ap-page .ap-card-foot .ap-check { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--ap-muted); cursor: pointer; }
.ap-page .ap-card-top .ap-src { margin-left: 0; }
@media (max-width: 480px) { .ap-page .ap-customize { flex-direction: column; } .ap-page .ap-customize .btn { width: 100%; } }

/* Make the apply button a proper button element */
.ap-page .ap-apply-btn { border: none; cursor: pointer; font: inherit; }

/* Apply-details form */
.ap-page .ap-applyinfo { border: 1px solid var(--ap-line); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; background: #fff; }
.ap-page .ap-applyinfo summary { cursor: pointer; font-weight: 600; color: var(--ap-ink); font-size: 0.9rem; }
.ap-page .ap-applyinfo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.ap-page .ap-applyinfo-grid input, .ap-page .ap-applyinfo-grid textarea { padding: 9px 12px; border: 1px solid var(--ap-line); border-radius: 8px; font: inherit; font-size: 0.88rem; background: #fff; color: var(--ap-ink); }
.ap-page .ap-applyinfo-grid textarea { grid-column: 1 / -1; resize: vertical; }
.ap-page .ap-applyinfo-grid .btn { grid-column: 1 / -1; justify-self: start; }
.ap-page .ap-applyinfo-grid input:focus, .ap-page .ap-applyinfo-grid textarea:focus { outline: none; border-color: var(--ap-accent); box-shadow: 0 0 0 3px var(--ap-weak); }
@media (max-width: 560px) { .ap-page .ap-applyinfo-grid { grid-template-columns: 1fr; } }

/* Cover-letter modal (appended to <body>) */
.ap-modal { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 16px; }
.ap-modal-box { background: #fff; border-radius: 16px; max-width: 560px; width: 100%; padding: 22px; box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.45); position: relative; }
.ap-modal-box h3 { margin: 0 0 4px; font-size: 1.1rem; color: #0f172a; }
.ap-modal-sub { color: #64748b; font-size: 0.88rem; margin: 0 0 12px; line-height: 1.5; }
.ap-modal-letter { width: 100%; border: 1px solid #e6e8ee; border-radius: 10px; padding: 12px; font: inherit; font-size: 0.9rem; line-height: 1.55; resize: vertical; color: #0f172a; background: #fff; }
.ap-modal-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.ap-modal-actions .btn { flex: 1; text-align: center; border: none; cursor: pointer; }
.ap-modal-copy { background: #2563eb; color: #fff; border: none; border-radius: 10px; font-weight: 600; padding: 11px 18px; cursor: pointer; }
.ap-modal-copy:hover { background: #1d4ed8; }
.ap-modal-open { background: #0f172a; color: #fff !important; border-radius: 10px; font-weight: 600; padding: 11px 18px; text-decoration: none; }
.ap-modal-x { position: absolute; top: 10px; right: 14px; background: none; border: none; font-size: 1.6rem; line-height: 1; color: #94a3b8; cursor: pointer; }

/* ===== Refined internship cards ===== */
.ap-page .ap-match {
    border: 1px solid #eef0f4;
    border-radius: 16px;
    padding: 18px;
    gap: 10px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.ap-page .ap-match:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -20px rgba(16, 24, 40, 0.25); border-color: #dfe3ea; }
.ap-page .ap-match--ext { border-left: 1px solid #eef0f4; }  /* drop the heavy blue bar */

.ap-page .ap-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ap-page .ap-logo {
    width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
    background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff;
    font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; justify-content: center;
}
.ap-page .ap-score { font-weight: 700; font-size: 0.72rem; padding: 5px 11px; border-radius: 999px; letter-spacing: 0.01em; background: none; }
.ap-page .ap-score--high { background: rgba(16, 185, 129, 0.12); color: #0e7c3a; }
.ap-page .ap-score--mid { background: rgba(37, 99, 235, 0.10); color: #1d4ed8; }
.ap-page .ap-score--low { background: #f1f4f9; color: #64748b; }

.ap-page .ap-match h3 { margin: 4px 0 0; font-size: 0.96rem; line-height: 1.35; }
.ap-page .ap-match .company-line { font-size: 0.8rem; color: #64748b; margin: 0; }
.ap-page .ap-match .job-card-tags { gap: 6px; }
.ap-page .ap-match .job-tag { background: #f4f6fa; color: #64748b; font-size: 0.72rem; padding: 3px 9px; border-radius: 6px; }

.ap-page .ap-apply-btn {
    margin-top: 6px; padding: 11px 16px; border-radius: 11px; font-weight: 600; font-size: 0.88rem;
    background: #2563eb; box-shadow: 0 8px 18px -8px rgba(37, 99, 235, 0.55);
}
.ap-page .ap-apply-btn:hover { background: #1d4ed8; }
.ap-page .ap-match.is-applied .ap-apply-btn { background: #16a34a; box-shadow: none; }

/* Extension auto-apply-all bar */
.ap-page .ap-extbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; padding: 14px 16px; border: 1px solid rgba(37, 99, 235, 0.25); background: rgba(37, 99, 235, 0.05); border-radius: 12px; }
.ap-page .ap-ext-btn { border: none; }
.ap-page .ap-ext-note { font-size: 0.84rem; color: #64748b; }
.ap-page .ap-ext-get { color: #2563eb; font-weight: 600; text-decoration: none; font-size: 0.92rem; }
.ap-page .ap-ext-get:hover { text-decoration: underline; }
