:root {
            color-scheme: light;
            --flip-duration: 0.7s;
            --primary: #2c3e50;
            --accent: #3498db;
            --accent-light: #3498db;
            --on-primary: #3498db;
            --accent-glow: rgba(52, 152, 219, 0.08);
            --image-accent-shadow: rgba(52, 152, 219, 0.2);
            --bg: #ecf0f1;
            --bg-top: #ecf0f1;
            --bg-bottom: #d5dbdd;
            --card-bg: #ffffff;
            --text: #2c2c2c;
            --shadow: rgba(44, 62, 80, 0.15);
            --page-overlay-secondary: rgba(44, 62, 80, 0.08);
            --utility-bg: rgba(255, 255, 255, 0.85);
            --utility-border: rgba(44, 62, 80, 0.28);
            --utility-hover-bg: #f6f9fb;
            --utility-shadow: 0 8px 18px rgba(44, 62, 80, 0.08);
            --modal-backdrop: rgba(22, 33, 44, 0.56);
            --modal-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
            --soft-divider: rgba(44, 62, 80, 0.15);
            --muted: #888888;
            --success: #1e8449;
            --notice-bg: #fff7cc;
            --notice-border: #d4b106;
            --notice-code-bg: rgba(255, 255, 255, 0.6);
            --template-bg: #fbfcfd;
            --group-surface: #f8f9fa;
            --group-border: #e0e0e0;
            --toggle-divider: rgba(0, 0, 0, 0.15);
            --switch-track: #cfd6dd;
            --switch-track-active: #3498db;
            --switch-thumb: #ffffff;
            --switch-thumb-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            --field-bg: #ffffff;
            --result-border: #e0e0e0;
            --glass-inset: rgba(255, 255, 255, 0.5);
            --card-frame-border: #2c3e50;
            --person-image-border: #2c3e50;
            --stacked-back-bg: rgba(0, 0, 0, 0.025);
            --stacked-back-border: #e6e6e6;
            --image-frame: #111111;
            --card-back-start: #2c3e50;
            --card-back-end: #34495e;
            --card-back-text: #ffffff;
            --card-back-link: #7cc7ff;
            --placeholder-start: #bdc3c7;
            --placeholder-end: #95a5a6;
        }

        :root[data-theme="dark"] {
            color-scheme: dark;
            --primary: #708aa3;
            --accent: #708aa3;
            --accent-light: #708aa3;
            --on-primary: #eef5fb;
            --accent-glow: rgba(112, 138, 163, 0.16);
            --image-accent-shadow: rgba(112, 138, 163, 0.18);
            --bg: #0f1720;
            --bg-top: #0b1118;
            --bg-bottom: #0f1821;
            --card-bg: #14212d;
            --text: #e6eef5;
            --shadow: rgba(0, 0, 0, 0.38);
            --page-overlay-secondary: rgba(112, 138, 163, 0.08);
            --utility-bg: rgba(20, 33, 45, 0.9);
            --utility-border: rgba(112, 138, 163, 0.32);
            --utility-hover-bg: #1d2b38;
            --utility-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
            --modal-backdrop: rgba(3, 8, 14, 0.76);
            --modal-shadow: 0 24px 60px rgba(0, 0, 0, 0.48);
            --soft-divider: rgba(112, 138, 163, 0.22);
            --muted: #9aabbb;
            --success: #79d69d;
            --notice-bg: rgba(163, 133, 20, 0.18);
            --notice-border: #e0c45a;
            --notice-code-bg: rgba(255, 255, 255, 0.08);
            --template-bg: #0f1a24;
            --group-surface: #192734;
            --group-border: #2c3c4b;
            --toggle-divider: rgba(255, 255, 255, 0.14);
            --switch-track: #324454;
            --switch-track-active: #708aa3;
            --switch-thumb: #edf5fb;
            --switch-thumb-shadow: 0 2px 8px rgba(0, 0, 0, 0.38);
            --field-bg: #0f1a24;
            --result-border: #2c3c4b;
            --glass-inset: rgba(117, 145, 168, 0.18);
            --card-frame-border: #708aa3;
            --person-image-border: #708aa3;
            --stacked-back-bg: rgba(255, 255, 255, 0.04);
            --stacked-back-border: #2b3947;
            --image-frame: #708aa3;
            --card-back-start: #14212d;
            --card-back-end: #14212d;
            --card-back-text: #e6eef5;
            --card-back-link: #708aa3;
            --placeholder-start: #5e7385;
            --placeholder-end: #364654;
        }

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

        body {
            font-family: 'Outfit', sans-serif;
            color: var(--text);
            background: linear-gradient(135deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
            min-height: 100vh;
            overflow-x: hidden;
            position: relative;
        }

        body::before {
            content: '';
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: 
                radial-gradient(circle at 20% 50%, var(--accent-glow) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, var(--page-overlay-secondary) 0%, transparent 50%);
            pointer-events: none;
            z-index: 0;
        }

        .app-container {
            position: relative;
            z-index: 1;
            max-width: 1200px;
            margin: 0 auto;
            padding: 2rem;
        }

        header {
            position: relative;
            text-align: center;
            margin-bottom: 2rem;
            animation: fadeIn 0.8s ease-out;
        }

        h1 {
            font-family: 'DM Serif Display', serif;
            font-size: 3rem;
            color: var(--primary);
            margin-bottom: 0.5rem;
            letter-spacing: -0.02em;
            font-style: italic;
        }


        .header-nav {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.6rem;
        }

        .subtitle {
            font-size: 1.1rem;
            color: var(--text);
            font-weight: 300;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            text-decoration: none;
        }

        .subtitle-sep {
            font-size: 1.1rem;
            color: var(--text);
            font-weight: 300;
            opacity: 0.4;
        }

        .header-utility {
            position: absolute;
            top: 0;
            right: 0;
            display: flex;
            align-items: center;
            gap: 0.6rem;
        }

        .theme-toggle {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.45rem;
            min-width: auto;
            min-height: 2.4rem;
            padding: 0.5rem 0.65rem;
            border: 1px solid var(--utility-border);
            border-radius: 999px;
            background: var(--utility-bg);
            color: var(--primary);
            cursor: pointer;
            box-shadow: var(--utility-shadow);
            transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
        }

        .theme-toggle:hover,
        .theme-toggle:focus-visible {
            transform: translateY(-1px);
            border-color: var(--primary);
            background: var(--utility-hover-bg);
            outline: none;
        }

        .theme-toggle-track {
            position: relative;
            display: inline-flex;
            align-items: center;
            width: 2.4rem;
            height: 1.4rem;
            padding: 0.15rem;
            background: var(--switch-track);
            border-radius: 999px;
            transition: background 0.2s ease;
        }

        .theme-toggle-thumb {
            display: block;
            width: 1.1rem;
            height: 1.1rem;
            border-radius: 50%;
            background: var(--switch-thumb);
            box-shadow: var(--switch-thumb-shadow);
            transform: translateX(0);
            transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
        }

        .theme-toggle[aria-pressed="true"] .theme-toggle-track {
            background: var(--switch-track-active);
        }

        .theme-toggle[aria-pressed="true"] .theme-toggle-thumb {
            transform: translateX(0.95rem);
        }

        .theme-toggle-icons,
        .theme-toggle-compact {
            gap: 0.45rem;
            min-width: auto;
            padding: 0.5rem 0.65rem;
            justify-content: center;
        }

        .theme-toggle-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 0.95rem;
            color: var(--muted);
            font-size: 0.88rem;
            line-height: 1;
            transition: color 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
        }

        .theme-toggle-compact[aria-pressed="false"] .theme-toggle-icon-sun,
        .theme-toggle-compact[aria-pressed="true"] .theme-toggle-icon-moon,
        .theme-toggle-icons[aria-pressed="false"] .theme-toggle-icon-sun,
        .theme-toggle-icons[aria-pressed="true"] .theme-toggle-icon-moon {
            color: var(--accent);
        }

        .theme-toggle-icons .theme-toggle-text,
        .theme-toggle-compact .theme-toggle-text {
            display: none;
        }

        :root[data-theme="dark"] .theme-toggle[aria-pressed="true"] .theme-toggle-icon-sun {
            opacity: 0.48;
            filter: grayscale(1) saturate(0.2);
        }

        .request-entry-launch {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid var(--utility-border);
            background: var(--utility-bg);
            color: var(--primary);
            font-family: 'Outfit', sans-serif;
            font-size: 0.78rem;
            font-weight: 600;
            letter-spacing: 0.04em;
            line-height: 1;
            text-transform: uppercase;
            min-width: 6.5rem;
            min-height: 2.4rem;
            padding: 0.5rem 0.65rem;
            border-radius: 999px;
            cursor: pointer;
            transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
            box-shadow: var(--utility-shadow);
        }

        .request-entry-launch:hover,
        .request-entry-launch:focus-visible {
            background: var(--primary);
            color: var(--on-primary);
            border-color: var(--primary);
            transform: translateY(-1px);
            outline: none;
        }

        body.modal-open {
            overflow: hidden;
        }

        .request-entry-modal[hidden] {
            display: none;
        }

        .request-entry-modal {
            position: fixed;
            inset: 0;
            z-index: 200;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1.5rem;
            background: var(--modal-backdrop);
            backdrop-filter: blur(5px);
        }

        .request-entry-dialog {
            width: min(760px, 100%);
            max-height: min(90vh, 860px);
            overflow-y: auto;
            background: var(--card-bg);
            border: 2px solid var(--primary);
            box-shadow: var(--modal-shadow);
            padding: 1.5rem;
        }

        .request-entry-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 1rem;
            margin-bottom: 1rem;
        }

        .request-entry-title {
            font-family: 'DM Serif Display', serif;
            font-size: 2rem;
            line-height: 1.05;
            color: var(--primary);
        }

        .request-entry-close {
            border: 1px solid var(--utility-border);
            background: transparent;
            color: var(--primary);
            font-family: 'Outfit', sans-serif;
            font-size: 0.82rem;
            font-weight: 700;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            padding: 0.45rem 0.75rem;
            cursor: pointer;
            white-space: nowrap;
        }

        .request-entry-close:hover,
        .request-entry-close:focus-visible {
            background: var(--primary);
            color: var(--on-primary);
            outline: none;
        }

        .request-entry-copy {
            font-size: 1rem;
            color: var(--text);
            line-height: 1.65;
            margin-bottom: 0.85rem;
        }

        .request-entry-notes {
            display: grid;
            gap: 0.75rem;
            margin-bottom: 1.2rem;
        }

        .request-entry-note {
            border-left: 3px solid var(--accent);
            background: var(--accent-glow);
            padding: 0.8rem 0.95rem;
            color: var(--text);
            line-height: 1.55;
        }

        .request-entry-note p + p {
            margin-top: 0.45rem;
        }

        .request-entry-actions {
            display: flex;
            gap: 0.75rem;
            flex-wrap: wrap;
            margin-bottom: 0.9rem;
        }

        .request-entry-action {
            border: 2px solid var(--primary);
            background: var(--card-bg);
            color: var(--primary);
            font-family: 'Outfit', sans-serif;
            font-size: 0.88rem;
            font-weight: 700;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            padding: 0.75rem 1rem;
            text-decoration: none;
            cursor: pointer;
            transition: background-color 0.2s ease, color 0.2s ease;
        }

        .request-entry-action:hover,
        .request-entry-action:focus-visible {
            background: var(--primary);
            color: var(--on-primary);
            outline: none;
        }

        .request-entry-status {
            min-height: 1.25rem;
            font-size: 0.82rem;
            font-weight: 600;
            letter-spacing: 0.02em;
            color: var(--success);
            margin-bottom: 0.8rem;
        }

        .request-entry-send-note {
            background: var(--notice-bg);
            border-left: 3px solid var(--notice-border);
            color: var(--text);
            font-size: 0.92rem;
            line-height: 1.55;
            padding: 0.85rem 0.95rem;
            margin-bottom: 0.8rem;
        }

        .request-entry-send-note code {
            font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
            background: var(--notice-code-bg);
            padding: 0.08rem 0.32rem;
        }

        .request-entry-template {
            width: 100%;
            min-height: 320px;
            border: 2px solid var(--primary);
            background: var(--template-bg);
            color: var(--text);
            font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
            font-size: 0.92rem;
            line-height: 1.55;
            padding: 1rem;
            resize: vertical;
        }

        .request-entry-template:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.12);
        }

        .section-divider {
            border: none;
            border-top: 1px solid var(--soft-divider);
            margin: 0 0 2rem;
            animation: fadeIn 1s ease-out 1.15s both;
        }

        .keyboard-hint {
            text-align: center;
            font-size: 0.72rem;
            color: var(--text);
            opacity: 0.4;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            margin-top: -1rem;
            margin-bottom: 2rem;
        }

        @media (hover: none) {
            .keyboard-hint { display: none; }
        }

        @media (hover: none), (pointer: coarse) {
            :root {
                --flip-duration: 0.38s;
            }
        }

        .filters-container {
            background: var(--card-bg);
            padding: 1.5rem;
            border: 2px solid var(--primary);
            margin-bottom: 2rem;
            animation: fadeIn 1s ease-out 1.2s both;
        }

        .filter-section-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
            flex-wrap: wrap;
            margin-bottom: 1rem;
        }

        .filters-toggle {
            padding: 0.45rem 1rem;
            border: 2px solid var(--primary);
            background: var(--card-bg);
            color: var(--primary);
            font-family: 'Outfit', sans-serif;
            font-weight: 600;
            font-size: 0.85rem;
            cursor: pointer;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            transition: all 0.3s ease;
        }

        .filters-toggle:hover {
            background: var(--primary);
            color: var(--on-primary);
        }

        .filters-container.collapsed .filters-content {
            display: none;
        }

        .filter-section {
            margin-bottom: 1.5rem;
        }


        .filter-section:last-child {
            margin-bottom: 0;
        }

        .filter-label {
            font-weight: 600;
            font-size: 0.9rem;
            color: var(--primary);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 0.75rem;
            display: block;
        }

        .filter-section-header .filter-label {
            margin-bottom: 0;
        }

        .checkbox-group {
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
        }

        .checkbox-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .checkbox-item input[type="checkbox"] {
            width: 18px;
            height: 18px;
            cursor: pointer;
        }

        .checkbox-item label {
            cursor: pointer;
            font-size: 0.95rem;
            color: var(--text);
        }

        .filter-warning {
            font-size: 0.75rem;
            color: var(--muted);
            font-style: italic;
            margin-top: 1rem;
            text-align: center;
        }

        /* Hierarchical checkbox styles */
        .filter-groups {
            display: flex;
            flex-wrap: wrap;
            gap: 1.5rem;
        }

        .filter-group {
            flex: 1;
            min-width: 200px;
            max-width: 300px;
            background: var(--group-surface);
            padding: 1rem;
            border-radius: 4px;
            border: 1px solid var(--group-border);
        }

        .group-header {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 0.75rem;
            padding-bottom: 0.5rem;
            border-bottom: 2px solid var(--primary);
        }

        .group-header input[type="checkbox"] {
            width: 18px;
            height: 18px;
            cursor: pointer;
            accent-color: var(--primary);
        }

        .group-header label {
            font-weight: 600;
            font-size: 0.95rem;
            color: var(--primary);
            cursor: pointer;
            text-transform: uppercase;
            letter-spacing: 0.03em;
        }

        .group-children {
            display: flex;
            flex-direction: column;
            gap: 0.4rem;
            padding-left: 0.5rem;
        }

        .group-children .checkbox-item input[type="checkbox"] {
            width: 16px;
            height: 16px;
            cursor: pointer;
            accent-color: var(--accent);
        }

        .controls {
            display: flex;
            justify-content: center;
            gap: 1rem;
            margin-bottom: 2rem;
            flex-wrap: wrap;
        }

        .filter-controls .btn {
            flex: 1;
            min-width: 160px;
            max-width: 220px;
        }

        .filter-controls {
            margin-top: 1.25rem;
            margin-bottom: 0;
        }

        .toggle-switch {
            display: inline-flex;
            align-items: center;
            gap: 0.8rem;
            padding: 0.6rem 1.2rem;
            border: 2px solid var(--primary);
            background: var(--card-bg);
            color: var(--primary);
            font-family: 'Outfit', sans-serif;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            flex-direction: column;
            align-items: center;
            text-align: center;
            min-width: 240px;
        }

        .toggle-label,
        .toggle-state {
            font-size: 0.85rem;
        }

        .toggle-label {
            position: relative;
            padding-bottom: 0.25rem;
            width: 100%;
        }

        .toggle-label::after {
            content: '';
            display: block;
            height: 2px;
            width: 100%;
            margin-top: 0.2rem;
            background: var(--toggle-divider);
        }

        .toggle-row {
            display: grid;
            grid-template-columns: 1fr auto 1fr;
            align-items: center;
            gap: 0.9rem;
            width: 100%;
        }

        .toggle-option {
            font-size: 0.75rem;
            letter-spacing: 0.05em;
            text-align: center;
        }

        .toggle-option.is-active {
            color: var(--accent);
            font-weight: 700;
        }

        .switch {
            position: relative;
            display: inline-block;
            width: 44px;
            height: 24px;
        }

        .switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: var(--switch-track);
            transition: 0.2s ease;
            border-radius: 999px;
        }

        .slider::before {
            position: absolute;
            content: "";
            height: 18px;
            width: 18px;
            left: 3px;
            top: 3px;
            background-color: var(--switch-thumb);
            transition: 0.2s ease;
            border-radius: 50%;
            box-shadow: var(--switch-thumb-shadow);
        }

        .switch input:checked + .slider {
            background-color: var(--switch-track-active);
        }

        .switch input:checked + .slider::before {
            transform: translateX(20px);
        }

        .search-container {
            background: var(--card-bg);
            padding: 1.5rem;
            border: 2px solid var(--primary);
            margin-bottom: 2rem;
            animation: fadeIn 1s ease-out 0.2s both;
        }

        .search-input {
            width: 100%;
            padding: 0.8rem 1rem;
            border: 2px solid var(--primary);
            font-size: 1rem;
            font-family: 'Outfit', sans-serif;
            margin-bottom: 0.75rem;
            color: var(--text);
            background: var(--field-bg);
        }

        .search-select {
            width: 100%;
            padding: 0.8rem 1rem;
            border: 2px solid var(--primary);
            font-size: 1rem;
            font-family: 'Outfit', sans-serif;
            margin-bottom: 0.75rem;
            color: var(--text);
            background: var(--field-bg);
        }

        .search-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 1rem;
            font-size: 0.9rem;
            color: var(--text);
            margin-bottom: 1.2rem;
            flex-wrap: wrap;
        }

        .results-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 1.25rem;
        }

        .result-card {
            background: var(--card-bg);
            border: 1px solid var(--result-border);
            box-shadow: 0 10px 30px var(--shadow);
            padding: 1rem;
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }

        .result-image {
            width: 100%;
            height: 240px;
            object-fit: cover;
            border: 3px solid var(--primary);
        }

        .result-name {
            font-size: 1.15rem;
            font-weight: 600;
            color: var(--primary);
        }

        .result-title {
            font-size: 0.95rem;
            color: var(--text);
            line-height: 1.4;
            white-space: pre-line;
        }

        .result-departments {
            font-size: 0.85rem;
            color: var(--text);
        }

        .result-email a {
            color: var(--accent);
            text-decoration: none;
            font-size: 0.85rem;
        }

        .back-to-top-btn {
            position: fixed;
            right: 1.25rem;
            bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
            z-index: 50;
            min-width: 56px;
            height: 56px;
            padding: 0 0.9rem;
            border: 2px solid var(--primary);
            border-radius: 999px;
            background: var(--card-bg);
            color: var(--primary);
            font-family: 'Outfit', sans-serif;
            font-size: 0.9rem;
            font-weight: 700;
            letter-spacing: 0.04em;
            text-transform: uppercase;
            box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
            cursor: pointer;
            opacity: 0;
            pointer-events: none;
            transform: translateX(16px);
            transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
        }

        .back-to-top-btn.is-visible {
            opacity: 1;
            pointer-events: auto;
            transform: translateX(0);
        }

        .back-to-top-btn:hover {
            background: var(--primary);
            color: var(--on-primary);
        }

        .btn {
            padding: 0.8rem 2rem;
            border: 2px solid var(--primary);
            background: var(--card-bg);
            color: var(--primary);
            font-family: 'Outfit', sans-serif;
            font-weight: 600;
            font-size: 1rem;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: var(--primary);
            transition: left 0.3s ease;
            z-index: -1;
        }

        .btn:hover::before {
            left: 0;
        }

        .btn:hover {
            color: var(--on-primary);
            border-color: var(--primary);
        }

        .btn.needs-apply,
        .btn.needs-apply:hover {
            border-color: #2ecc71;
            box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.2), 0 0 14px rgba(46, 204, 113, 0.8);
            animation: applyReminderGlow 1.3s ease-in-out infinite alternate;
        }

        .btn.active {
            background: var(--primary);
            color: var(--card-bg);
        }

        .progress {
            text-align: center;
            margin-bottom: 2rem;
            font-size: 1.1rem;
            color: var(--text);
            font-weight: 400;
            animation: fadeIn 1.2s ease-out 0.4s both;
        }

        .progress strong {
            color: var(--accent);
            font-weight: 800;
        }

        .flashcard-container {
            perspective: 1000px;
            -webkit-perspective: 1000px;
            margin: 0 auto 2rem;
            max-width: 500px;
            height: 600px;
            animation: slideUp 1s ease-out 0.6s both;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }

        .stacked-mode .flashcard-container {
            perspective: none;
            height: 600px;
            align-items: center;
        }

        .flash-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: var(--primary);
            opacity: 0;
            pointer-events: none;
            z-index: 10;
            transition: opacity 0.1s ease;
        }

        .flash-overlay.active {
            opacity: 1;
        }

        .stacked-mode .flash-overlay {
            display: none;
        }

        .flashcard {
            width: 100%;
            height: 600px;
            position: relative;
            transform-style: preserve-3d;
            -webkit-transform-style: preserve-3d;
            transition: transform var(--flip-duration) cubic-bezier(0.4, 0, 0.2, 1);
            cursor: pointer;
        }

        .stacked-mode .flashcard {
            height: 600px;
            transform: none;
            cursor: default;
            display: grid;
            grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
            box-shadow: 
                0 20px 60px var(--shadow),
                0 0 0 1px var(--glass-inset) inset;
        }

        .flashcard.flipped {
            transform: rotateY(180deg);
        }

        .card-face {
            position: absolute;
            width: 100%;
            height: 100%;
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
            background: var(--card-bg);
            border: 3px solid var(--card-frame-border);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 0;
            box-shadow: 
                0 20px 60px var(--shadow),
                0 0 0 1px var(--glass-inset) inset;
            top: 0;
            left: 0;
            overflow: hidden;
        }

        .stacked-mode .card-face {
            position: static;
            height: 100%;
            backface-visibility: visible;
            box-shadow: none;
        }

        .stacked-mode .card-front {
            border-bottom: 0;
            height: 100%;
        }

        .stacked-mode .card-back {
            transform: none;
            border-top: 3px solid var(--primary);
            visibility: hidden;
            opacity: 0;
            background: var(--stacked-back-bg);
            transition: opacity 0.2s ease-in-out, background 0.2s ease-in-out;
            height: 100%;
        }

        .stacked-mode .card-content {
            height: 100%;
            justify-content: center;
        }

        .stacked-mode .flashcard:not(.revealed) .card-back {
            border: 3px solid var(--stacked-back-border);
        }

        .stacked-mode .card-front::before {
            display: none;
        }

        .stacked-mode .card-back::before {
            display: none;
        }

        .stacked-mode .person-image {
            width: 190px;
            height: 230px;
            margin-bottom: 0.4rem;
            border: 2px solid var(--image-frame);
            box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
        }

        .stacked-mode .flashcard.revealed .card-back {
            visibility: visible;
            opacity: 1;
            background: linear-gradient(135deg, var(--card-back-start) 0%, var(--card-back-end) 100%);
        }

        .card-front {
            position: relative;
        }

        .card-front::before {
            content: '';
            position: absolute;
            top: 1rem;
            left: 1rem;
            right: 1rem;
            bottom: 1rem;
            border: 1px solid var(--accent);
            opacity: 0.3;
            pointer-events: none;
        }

        .card-back {
            transform: rotateY(180deg);
            background: linear-gradient(135deg, var(--card-back-start) 0%, var(--card-back-end) 100%);
            color: var(--card-back-text);
            border-color: var(--accent);
        }

        .card-back::before {
            content: '';
            position: absolute;
            top: 1rem;
            left: 1rem;
            right: 1rem;
            bottom: 1rem;
            border: 1px solid var(--accent);
            opacity: 0.5;
            pointer-events: none;
        }

        .card-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
            width: 100%;
            padding: 2rem;
        }

        .card-back .card-content {
            display: none;
        }

        .card-back .card-content.active {
            display: flex;
        }

        .person-image {
            width: 280px;
            height: 320px;
            object-fit: cover;
            border: 4px solid var(--person-image-border);
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
            box-shadow: 
                0 10px 30px rgba(0, 0, 0, 0.2),
                0 0 0 8px var(--image-accent-shadow);
            margin-bottom: 1.5rem;
            transition: transform 0.3s ease;
            transform: translate3d(0, 0, 0);
        }

        .flashcard:hover .person-image {
            transform: translate3d(0, -5px, 0);
        }

        .card-hint {
            font-size: 0.9rem;
            color: var(--text);
            opacity: 0;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            transition: opacity 0.3s ease;
        }

        .flashcard:hover .card-hint {
            opacity: 0.5;
        }

        .stacked-mode .card-hint {
            display: block;
            font-size: 0.75rem;
            letter-spacing: 0.05em;
            margin-top: 0.2rem;
        }

        .stacked-mode .flashcard:hover .card-hint {
            opacity: 0.6;
        }

        .stacked-mode .flashcard:hover .person-image {
            transform: translate3d(0, -2px, 0);
        }

        @media (hover: none), (pointer: coarse) {
            .flashcard {
                will-change: transform;
            }

            .card-front {
                -webkit-transform: translateZ(0);
                transform: translateZ(0);
            }

            .card-back {
                -webkit-transform: rotateY(180deg) translateZ(0);
                transform: rotateY(180deg) translateZ(0);
            }

            .person-image {
                transition: none;
            }

            .flashcard:hover .person-image,
            .stacked-mode .flashcard:hover .person-image {
                transform: translate3d(0, 0, 0);
            }
        }

        .faculty-name,
        .staff-name {
            font-family: 'Outfit', sans-serif;
            font-size: 2rem;
            color: var(--card-back-text);
            font-weight: 600;
            line-height: 1.2;
            text-align: center;
        }

        .faculty-name {
            margin-bottom: 1rem;
        }

        .staff-name {
            margin-bottom: 0.5rem;
        }

        .faculty-departments {
            font-size: 1rem;
            line-height: 1.6;
            font-weight: 400;
            text-align: center;
            margin-bottom: 1rem;
        }

        .dept-tag {
            display: inline;
        }

        .dept-biology { color: #27ae60; }
        .dept-chemistry { color: #e74c3c; }
        .dept-cs { color: #9b59b6; }
        .dept-engineering { color: #e67e22; }
        .dept-hixon { color: #1abc9c; }
        .dept-hsa { color: #f39c12; }
        .dept-dof { color: #16a085; }
        .dept-mathematics { color: #3498db; }
        .dept-physics { color: #00bcd4; }

        .dept-dco { color: #3498db; }
        .dept-dsa { color: #9b59b6; }
        .dept-enrollment { color: #e67e22; }
        .dept-admin { color: #27ae60; }
        .dept-default { color: var(--accent-light); }

        .faculty-title,
        .staff-title {
            font-size: 1.1rem;
            color: var(--card-back-text);
            line-height: 1.6;
            font-weight: 300;
            white-space: pre-line;
            opacity: 0.95;
            margin-bottom: 1rem;
            text-align: center;
        }

        .faculty-education {
            font-size: 0.9rem;
            color: var(--card-back-text);
            opacity: 0.75;
            font-weight: 300;
            font-style: italic;
            text-align: center;
        }

        .faculty-education::before {
            content: '(';
        }

        .faculty-education::after {
            content: ')';
        }

        .staff-department {
            font-size: 1rem;
            line-height: 1.6;
            font-weight: 400;
            margin-bottom: 1rem;
            text-align: center;
        }

        .staff-email {
            font-size: 0.9rem;
            color: var(--card-back-text);
            opacity: 0.7;
            font-weight: 300;
        }

        .staff-email a {
            color: var(--card-back-link);
            text-decoration: none;
        }

        .navigation {
            display: flex;
            justify-content: center;
            gap: 1rem;
            margin-bottom: 1rem;
            animation: fadeIn 1.4s ease-out 0.8s both;
        }

        .navigation .btn,
        .navigation .nav-btn {
            flex: 1;
            min-width: 0;
            max-width: 280px;
            text-align: center;
            padding: 1rem 0;
            font-size: 1.1rem;
        }

        .shuffle-controls {
            display: flex;
            justify-content: center;
            animation: fadeIn 1s ease-out 1.0s both;
        }

        .view-controls {
            animation: fadeIn 1s ease-out 1.1s both;
        }

        .shuffle-controls .nav-btn {
            width: 100%;
            max-width: 280px;
        }

        .nav-btn {
            border: 2px solid var(--primary);
            background: var(--card-bg);
            color: var(--primary);
            font-family: 'Outfit', sans-serif;
            font-weight: 600;
            font-size: 1.1rem;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .nav-btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: var(--primary);
            transition: left 0.3s ease;
            z-index: -1;
        }

        .nav-btn:hover::before {
            left: 0;
        }

        .nav-btn:hover {
            color: var(--on-primary);
        }

        .nav-btn:disabled {
            opacity: 0.3;
            cursor: not-allowed;
        }

        .nav-btn:disabled:hover {
            color: var(--primary);
            background: var(--card-bg);
        }

        .nav-btn:disabled::before {
            left: -100%;
        }

        .no-results {
            text-align: center;
            padding: 3rem;
            color: var(--text);
            font-size: 1.2rem;
        }

        /* Placeholder for missing images */
        .person-image.placeholder {
            background: linear-gradient(135deg, var(--placeholder-start) 0%, var(--placeholder-end) 100%);
            display: flex;
            align-items: center;
            justify-content: center;
        }


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

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(50px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes applyReminderGlow {
            from {
                box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.18), 0 0 8px rgba(46, 204, 113, 0.55);
            }
            to {
                box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.28), 0 0 18px rgba(46, 204, 113, 0.95);
            }
        }

        @media (max-width: 865px) {
            .header-utility {
                position: static;
                margin-top: 1rem;
                justify-content: center;
                flex-wrap: wrap;
            }

            .result-image {
                aspect-ratio: 1 / 1;
                height: auto;
            }
        }

        @media (max-width: 768px) {
            h1 {
                font-size: 2.2rem;
            }

            .app-container {
                padding: 1.5rem;
            }

            .request-entry-dialog {
                padding: 1.2rem;
            }

            .request-entry-title {
                font-size: 1.7rem;
            }

            .flashcard-container {
                height: 550px;
            }

            .flashcard {
                height: 550px;
            }

            .stacked-mode .flashcard-container,
            .stacked-mode .flashcard {
                height: 550px;
            }

            .person-image {
                width: 220px;
                height: 260px;
            }

            .stacked-mode .person-image {
                width: 180px;
                height: 220px;
            }

            .card-content {
                padding: 1.5rem;
            }

            .faculty-name,
            .staff-name {
                font-size: 1.6rem;
            }

            .faculty-title,
            .staff-title {
                font-size: 1rem;
            }

            .filter-groups {
                flex-direction: column;
            }

            .filter-group {
                max-width: 100%;
            }

            .controls {
                gap: 0.75rem;
            }

            .back-to-top-btn {
                right: 1rem;
                bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
                min-width: 52px;
                height: 52px;
            }
        }

        @media (max-width: 600px) {
            .app-container {
                padding: 1.2rem;
            }

            .request-entry-header {
                flex-direction: column;
            }

            .request-entry-close,
            .request-entry-action {
                width: 100%;
                text-align: center;
            }

            .controls {
                flex-direction: column;
            }

            .navigation .nav-btn,
            .navigation .btn {
                max-width: none;
                font-size: 0.88rem;
                padding: 0.75rem 0.5rem;
            }

            .shuffle-controls .nav-btn {
                max-width: none;
                width: 100%;
            }

            .keyboard-hint {
                text-align: center;
                width: 100%;
            }

            .flashcard-container,
            .flashcard {
                height: 500px;
            }

            .stacked-mode .flashcard-container,
            .stacked-mode .flashcard {
                height: 500px;
            }

            .person-image {
                width: 200px;
                height: 240px;
            }

            .stacked-mode .person-image {
                width: 170px;
                height: 210px;
            }

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

        }

        @media (max-width: 480px) {
            h1 {
                font-size: 1.9rem;
            }

            .request-entry-modal {
                padding: 0.9rem;
            }

            .request-entry-template {
                min-height: 360px;
            }

            .flashcard-container,
            .flashcard {
                height: 450px;
            }

            .stacked-mode .flashcard-container,
            .stacked-mode .flashcard {
                height: 450px;
            }

            .person-image {
                width: 180px;
                height: 220px;
            }

            .stacked-mode .person-image {
                width: 160px;
                height: 200px;
            }

            .faculty-name,
            .staff-name {
                font-size: 1.4rem;
            }

            .faculty-title,
            .staff-title {
                font-size: 0.9rem;
            }

            .filter-group {
                padding: 0.8rem;
            }

            .back-to-top-btn {
                right: 0.75rem;
                bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
                min-width: 48px;
                height: 48px;
                font-size: 0.8rem;
            }
        }
