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

body {
    font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: hsl(0 0% 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#extractorPage, #historyPage {
    width: 100%;
}

.container {
    background: hsl(0 0% 100%);
    border-radius: 0.75rem;
    border: 1px solid hsl(240 5.9% 90%);
    padding: 0; 
    max-width: 680px; 
    width: 100%;
    margin: 2rem auto;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    transition: max-width 0.4s ease;
    overflow: hidden;
}

/* New Shadcn File-Upload Card Styles */
.upload-card-inner {
    padding: 1.5rem; /* p-6 */
}

.upload-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.upload-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.upload-icon-circle {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background-color: hsl(240 4.8% 95.9%); /* bg-muted */
    color: hsl(240 3.8% 46.1%); /* text-muted-foreground */
}

h3.upload-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: hsl(240 10% 3.9%);
    margin: 0;
}

p.upload-subtitle {
    font-size: 0.875rem;
    color: hsl(240 3.8% 46.1%);
    margin: 0.25rem 0 0 0;
    text-align: left;
}

.upload-area {
    border: 2px dashed hsl(240 5.9% 90%); /* border-muted-foreground/30 roughly */
    border-radius: 0.5rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.upload-area:hover, .upload-area.drag-over {
    border-color: hsl(240 5.9% 70%); /* hover:border:primary/50 slightly lighter */
    background: hsl(240 4.8% 95.9% / 0.5);
}

.upload-label-zone {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.cloud-big {
    width: 2.5rem;
    height: 2.5rem;
    color: hsl(240 3.8% 46.1%);
    margin-bottom: 1rem;
}

.dropzone-title {
    font-weight: 600;
    color: hsl(240 10% 3.9%);
    margin: 0;
}

.dropzone-desc {
    font-size: 0.75rem;
    color: hsl(240 3.8% 46.1%);
    margin: 0.25rem 0 0 0;
}

.browse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid hsl(240 5.9% 90%);
    background: hsl(0 0% 100%);
    color: hsl(240 10% 3.9%);
    height: 2.25rem;
    border-radius: 0.375rem;
    padding: 0 0.75rem;
    margin-top: 1rem;
    pointer-events: none;
}

.file-preview-container {
    padding: 1.5rem;
    border-top: 1px solid hsl(240 5.9% 90%); /* border-t */
}

.preview-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.preview-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preview-item-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.preview-file-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    background: hsl(240 4.8% 95.9%);
    font-size: 0.875rem;
    font-weight: 700;
    color: hsl(240 3.8% 46.1%);
}

.preview-file-details {
    flex: 1;
    text-align: left;
}

.preview-filename {
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(240 10% 3.9%);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 15rem;
    margin: 0;
}

@media (min-width: 640px) {
    .preview-filename {
        max-width: 20rem;
    }
}

.preview-filestatus {
    font-size: 0.75rem;
    color: hsl(240 3.8% 46.1%);
    display: flex;
    align-items: center;
    margin-top: 0.125rem;
}

.preview-dot {
    margin: 0 0.25rem;
}

.status-completed {
    color: #22c55e; /* text-green-500 */
}

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

.icon-completed {
    width: 1.25rem;
    height: 1.25rem;
    color: #22c55e;
}

.icon-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: transparent;
    border: none;
    color: hsl(240 10% 3.9%);
    cursor: pointer;
}

.icon-delete:hover {
    background: hsl(240 4.8% 95.9%);
}

.icon-delete svg {
    width: 1rem;
    height: 1rem;
    color: hsl(240 10% 3.9%);
}

.extract-btn, .copy-btn, .open-tab-btn {
    flex: 1;
    padding: 0.625rem 1rem;
    background: hsl(240 10% 3.9%);
    color: hsl(0 0% 98%);
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: 'Figtree', sans-serif;
}

.btn-with-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
}

.btn-with-icon svg {
    flex-shrink: 0;
}

.extract-btn:hover, .copy-btn:hover, .open-tab-btn:hover {
    background: hsl(240 10% 3.9% / 0.9);
}

.extract-btn:active, .copy-btn:active, .open-tab-btn:active {
    background: hsl(240 10% 3.9% / 0.8);
}

.result-buttons {
    display: flex;
    gap: 0.75rem;
}

.open-tab-btn {
    background: hsl(0 0% 100%);
    color: hsl(240 10% 3.9%);
    border: 1px solid hsl(240 5.9% 90%);
}

.open-tab-btn:hover {
    background: hsl(240 4.8% 95.9%);
    border-color: hsl(240 5.9% 70%);
}

.open-tab-btn:active {
    background: hsl(240 4.8% 90%);
}

.button-group {
    display: flex;
    gap: 0.75rem;
    padding: 0 1.5rem 1.5rem 1.5rem;
}

.upload-another-btn {
    flex: 1;
    padding: 0.625rem 1rem;
    background: hsl(0 0% 100%);
    color: hsl(240 10% 3.9%);
    border: 1px solid hsl(240 5.9% 90%);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Figtree', sans-serif;
}

.upload-another-btn:hover {
    background: hsl(240 4.8% 95.9%);
    border-color: hsl(240 5.9% 70%);
}

.extract-btn {
    flex: 1;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem;
    min-height: 250px;
}

#loadingText {
    font-size: 1.125rem;
    font-weight: 500;
    margin: 0;
    
    background-image: linear-gradient(
        90deg,
        hsl(240 10% 3.9%) 0%,
        hsl(240 10% 3.9%) 35%,
        hsl(240 5.9% 70%) 50%,
        hsl(240 10% 3.9%) 65%,
        hsl(240 10% 3.9%) 100%
    );
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: textShimmer 2.5s linear infinite;
}

@keyframes textShimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.spinner {
    border: 3px solid hsl(240 5.9% 90%);
    border-top: 3px solid hsl(240 10% 3.9%);
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1.5rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.result {
    padding: 0 1.5rem 1.5rem 1.5rem;
}

.result h2 {
    color: hsl(240 10% 3.9%);
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.container.result-expanded {
    max-width: 900px;
}

.extracted-text {
    background: hsl(220 14% 92%);
    border-radius: 0.5rem;
    padding: 1.5rem;
    max-height: 75vh;
    overflow-y: auto;
    color: hsl(240 10% 3.9%);
    line-height: 1.7;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-family: 'Figtree', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif;
}

.extracted-text::-webkit-scrollbar {
    width: 6px;
}

.extracted-text::-webkit-scrollbar-track {
    background: hsl(220 14% 92%);
    border-radius: 3px;
}

.extracted-text::-webkit-scrollbar-thumb {
    background: hsl(240 5.9% 70%);
    border-radius: 3px;
}

.extracted-text::-webkit-scrollbar-thumb:hover {
    background: hsl(240 5.9% 60%);
}

.extracted-text {
    scrollbar-width: thin;
    scrollbar-color: hsl(240 5.9% 70%) hsl(220 14% 92%);
}

.doc-page {
    background: hsl(0 0% 100%);
    border: 1px solid hsl(240 5.9% 88%);
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    padding: 2.5rem 2.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    white-space: pre-wrap;
    word-wrap: break-word;
    tab-size: 4;
    line-height: 1.75;
    min-height: 200px;
}

.doc-page:last-child {
    margin-bottom: 0;
}

.doc-page.portrait {
    max-width: 100%;
    width: 100%;
}

.doc-page.landscape {
    max-width: 100%;
    width: 100%;
}

.doc-page-number {
    position: absolute;
    top: 0;
    right: 0;
    background: hsl(240 10% 3.9%);
    color: hsl(0 0% 98%);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 0 4px 0 6px;
    font-family: 'Figtree', sans-serif;
    letter-spacing: 0.03em;
}

.doc-page-content {
    font-family: 'Figtree', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', sans-serif;
}

.markdown-table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.75rem 0;
    background: hsl(0 0% 100%);
    font-family: 'Figtree', sans-serif;
    font-size: 0.85rem;
}

.markdown-table th,
.markdown-table td {
    border: 1px solid hsl(240 5.9% 85%);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.markdown-table th {
    background: hsl(240 4.8% 95.9%);
    font-weight: 600;
    color: hsl(240 10% 3.9%);
}

.markdown-table tr:nth-child(even) {
    background: hsl(240 4.8% 98%);
}

.doc-page h1,
.doc-page-content h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.75rem 0 0.5rem 0;
    font-family: 'Figtree', sans-serif;
    color: hsl(240 10% 3.9%);
    line-height: 1.3;
}

.doc-page h2,
.doc-page-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0.625rem 0 0.4rem 0;
    font-family: 'Figtree', sans-serif;
    color: hsl(240 10% 8%);
    line-height: 1.3;
}

.doc-page h3,
.doc-page-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0.5rem 0 0.35rem 0;
    font-family: 'Figtree', sans-serif;
    color: hsl(240 10% 12%);
    line-height: 1.3;
}

.doc-page strong { font-weight: 700; }
.doc-page em { font-style: italic; }

.doc-blockquote {
    border-left: 3px solid hsl(240 10% 3.9%);
    background: hsl(240 4.8% 96.5%);
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    border-radius: 0 4px 4px 0;
    font-style: normal;
}

.doc-code {
    background: hsl(240 4.8% 93%);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
}

.doc-page ul, .doc-page ol {
    padding-left: 1.5rem;
    margin: 0.35rem 0;
}

.doc-page li {
    margin-bottom: 0.2rem;
}

.doc-page hr {
    border: none;
    border-top: 1px solid hsl(240 5.9% 85%);
    margin: 1rem 0;
}

.extracted-text.single-result {
    background: hsl(0 0% 100%);
    border: 1px solid hsl(240 5.9% 88%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 2.5rem;
    border-radius: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
    tab-size: 4;
}

.hidden {
    display: none;
}

.progress-container {
    margin-top: 1.5rem;
    width: 100%;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: hsl(240 10% 3.9%);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: hsl(240 5.9% 90%);
    border-radius: 9999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: hsl(240 10% 3.9%);
    border-radius: 9999px;
    transition: width 0.3s ease;
    width: 0%;
}

#loadingText {
    font-weight: 500;
    color: hsl(240 10% 3.9%);
}

/* Navigation Bar */
.navbar {
    background: hsl(0 0% 100%);
    border-bottom: 1px solid hsl(240 5.9% 90%);
    padding: 1rem 2rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-icon {
    color: hsl(240 10% 3.9%);
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 600;
    color: hsl(240 10% 3.9%);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.token-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: hsl(240 4.8% 95.9%);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid hsl(240 5.9% 90%);
}

.token-icon {
    color: hsl(240 10% 3.9%);
    flex-shrink: 0;
}

.token-label {
    font-size: 0.875rem;
    color: hsl(240 10% 3.9%);
    font-weight: 500;
}

.token-count {
    font-size: 1rem;
    font-weight: 600;
    color: hsl(240 10% 3.9%);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-info.logged-out .user-name,
.user-info.logged-out .sign-out-btn {
    display: none;
}

.user-info.logged-in {
    display: flex;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid hsl(240 5.9% 90%);
    overflow: hidden;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.user-avatar.default-avatar {
    background: hsl(240 4.8% 95.9%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: hsl(240 10% 3.9%);
}

.user-avatar.default-avatar svg {
    width: 20px;
    height: 20px;
}

.google-signin-wrapper {
    display: none;
}

.google-signin-wrapper.show {
    display: block;
}

.google-signin-wrapper * {
    font-family: 'Figtree', sans-serif !important;
}

.nsm7Bb-HzV7m-LgbsSe-BPrWId {
    font-family: 'Figtree', sans-serif !important;
}

.user-name {
    font-size: 0.875rem;
    color: hsl(240 10% 3.9%);
    font-weight: 500;
    white-space: nowrap;
}

.sign-out-btn {
    padding: 0.5rem 1rem;
    background: hsl(0 0% 100%);
    color: hsl(240 10% 3.9%);
    border: 1px solid hsl(240 5.9% 90%);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Figtree', sans-serif;
}

.sign-out-btn:hover {
    background: hsl(240 4.8% 95.9%);
    border-color: hsl(240 5.9% 70%);
}

body {
    padding-top: 80px;
    background: hsl(0 0% 98%);
}

.login-prompt {
    text-align: center;
    padding: 3rem 2rem;
    background: hsl(240 4.8% 95.9%);
    border: 1px solid hsl(240 5.9% 90%);
    border-radius: 0.5rem;
    margin-top: 2rem;
}

.login-prompt p {
    color: hsl(240 10% 3.9%);
    font-size: 1rem;
    margin: 0;
}

.token-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.token-modal.hidden {
    display: none;
}

.token-modal-content {
    background: hsl(0 0% 100%);
    border-radius: 0.5rem;
    border: 1px solid hsl(240 5.9% 90%);
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.token-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid hsl(240 5.9% 90%);
}

.token-modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: hsl(240 10% 3.9%);
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: hsl(240 10% 3.9%);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
    transition: background 0.2s;
}

.close-modal:hover {
    background: hsl(240 4.8% 95.9%);
}

.token-modal-body {
    padding: 1.5rem;
}

.token-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid hsl(240 5.9% 90%);
}

.token-info-row:last-child {
    border-bottom: none;
}

.token-info-label {
    font-size: 0.875rem;
    color: hsl(240 3.8% 46.1%);
}

.token-info-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(240 10% 3.9%);
}

.token-display {
    cursor: pointer;
    transition: all 0.2s;
}

.token-display:hover {
    background: hsl(240 4.8% 90%);
}

.admin-btn {
    padding: 0.5rem 1rem;
    background: hsl(240 10% 3.9%);
    color: hsl(0 0% 98%);
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Figtree', sans-serif;
}

.admin-btn:hover {
    background: hsl(240 10% 3.9% / 0.9);
}

.admin-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.admin-modal.hidden {
    display: none;
}

.admin-modal-content {
    background: hsl(0 0% 100%);
    border-radius: 0.5rem;
    border: 1px solid hsl(240 5.9% 90%);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.admin-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid hsl(240 5.9% 90%);
    position: sticky;
    top: 0;
    background: hsl(0 0% 100%);
    z-index: 1;
}

.admin-modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: hsl(240 10% 3.9%);
    margin: 0;
}

.admin-modal-body {
    padding: 1.5rem;
}

.admin-search {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.admin-input {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 1px solid hsl(240 5.9% 90%);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: 'Figtree', sans-serif;
    color: hsl(240 10% 3.9%);
}

.admin-input:focus {
    outline: none;
    border-color: hsl(240 10% 3.9%);
}

.admin-search-btn {
    padding: 0.625rem 1.5rem;
    background: hsl(240 10% 3.9%);
    color: hsl(0 0% 98%);
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Figtree', sans-serif;
}

.admin-search-btn:hover {
    background: hsl(240 10% 3.9% / 0.9);
}

.user-not-found {
    padding: 1rem;
    background: hsl(0 84.2% 60.2% / 0.1);
    border: 1px solid hsl(0 84.2% 60.2% / 0.3);
    border-radius: 0.375rem;
    color: hsl(0 84.2% 40%);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.user-token-info {
    background: hsl(240 4.8% 95.9%);
    border: 1px solid hsl(240 5.9% 90%);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.admin-token-controls {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid hsl(240 5.9% 90%);
}

.admin-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(240 10% 3.9%);
    margin-bottom: 0.75rem;
}

.admin-token-input-group {
    display: flex;
    gap: 0.75rem;
}

.admin-token-input-group .admin-input {
    width: 120px;
}

.admin-action-btn {
    padding: 0.625rem 1.5rem;
    background: hsl(142.1 76.2% 36.3%);
    color: hsl(0 0% 98%);
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Figtree', sans-serif;
}

.admin-action-btn:hover {
    background: hsl(142.1 76.2% 30%);
}

.admin-quick-actions {
    margin-top: 1rem;
}

.admin-action-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.admin-quick-btn {
    padding: 0.5rem 1rem;
    background: hsl(0 0% 100%);
    color: hsl(240 10% 3.9%);
    border: 1px solid hsl(240 5.9% 90%);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Figtree', sans-serif;
}

.admin-quick-btn:hover {
    background: hsl(240 4.8% 95.9%);
    border-color: hsl(240 5.9% 70%);
}

.admin-add-btn {
    background: hsl(142.1 76.2% 36.3% / 0.1);
    border-color: hsl(142.1 76.2% 36.3% / 0.3);
    color: hsl(142.1 76.2% 30%);
}

.admin-add-btn:hover {
    background: hsl(142.1 76.2% 36.3% / 0.2);
    border-color: hsl(142.1 76.2% 36.3% / 0.5);
}

.admin-remove-btn {
    background: hsl(0 84.2% 60.2% / 0.1);
    border-color: hsl(0 84.2% 60.2% / 0.3);
    color: hsl(0 84.2% 40%);
}

.admin-remove-btn:hover {
    background: hsl(0 84.2% 60.2% / 0.2);
    border-color: hsl(0 84.2% 60.2% / 0.5);
}

.admin-zero-btn {
    background: hsl(0 0% 20% / 0.1);
    border-color: hsl(0 0% 20% / 0.3);
    color: hsl(0 0% 20%);
}

.admin-zero-btn:hover {
    background: hsl(0 0% 20% / 0.2);
    border-color: hsl(0 0% 20% / 0.5);
}

.admin-all-users {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid hsl(240 5.9% 90%);
}

.admin-all-users h4 {
    font-size: 1rem;
    font-weight: 600;
    color: hsl(240 10% 3.9%);
    margin-bottom: 1rem;
}

.all-users-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.user-card {
    background: hsl(0 0% 100%);
    border: 1px solid hsl(240 5.9% 90%);
    border-radius: 0.375rem;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.user-card:hover {
    border-color: hsl(240 5.9% 70%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.user-card-info {
    flex: 1;
}

.user-card-email {
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(240 10% 3.9%);
    margin-bottom: 0.25rem;
}

.user-card-tokens {
    font-size: 0.75rem;
    color: hsl(240 3.8% 46.1%);
}

.user-card-select {
    padding: 0.5rem 1rem;
    background: hsl(240 10% 3.9%);
    color: hsl(0 0% 98%);
    border: none;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Figtree', sans-serif;
}

.user-card-select:hover {
    background: hsl(240 10% 3.9% / 0.9);
}

.no-users {
    text-align: center;
    color: hsl(240 3.8% 46.1%);
    font-size: 0.875rem;
    padding: 2rem;
}

.history-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    color: hsl(240 10% 3.9%);
    border: 1px solid hsl(240 5.9% 90%);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Figtree', sans-serif;
}

.history-btn:hover {
    background: hsl(240 4.8% 95.9%);
    border-color: hsl(240 5.9% 70%);
}

.history-page-container {
    max-width: 800px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1rem;
}

.history-page-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
}

.back-btn {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    color: hsl(240 10% 3.9%);
    border: 1px solid hsl(240 5.9% 90%);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Figtree', sans-serif;
}

.back-btn:hover {
    background: hsl(240 4.8% 95.9%);
    border-color: hsl(240 5.9% 70%);
}

.history-page-title {
    text-align: center;
}

.history-page-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.history-page-card {
    background: hsl(0 0% 100%);
    border: 1px solid hsl(240 5.9% 90%);
    border-radius: 0.5rem;
    padding: 1.5rem;
    transition: all 0.2s;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.history-page-card:hover {
    border-color: hsl(240 5.9% 80%);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.history-page-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid hsl(240 5.9% 90%);
}

.history-page-card-filename {
    font-weight: 600;
    color: hsl(240 10% 3.9%);
    font-size: 1rem;
}

.no-history {
    text-align: center;
    color: hsl(240 3.8% 46.1%);
    font-size: 0.875rem;
    padding: 3rem;
}

.history-page-card-date {
    font-size: 0.875rem;
    color: hsl(240 3.8% 46.1%);
}

.history-page-card-body {
    background: hsl(220 14% 92%);
    border-radius: 0.5rem;
    padding: 1rem 1.5rem;
    max-height: 400px;
    overflow-y: auto;
    color: hsl(240 10% 3.9%);
    line-height: 1.7;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    white-space: pre-wrap;
}

.history-page-card-body::-webkit-scrollbar {
    width: 6px;
}
.history-page-card-body::-webkit-scrollbar-track {
    background: transparent;
}
.history-page-card-body::-webkit-scrollbar-thumb {
    background: hsl(240 5.9% 70%);
    border-radius: 3px;
}

.history-page-card-actions {
    display: flex;
    gap: 0.75rem;
}

.history-page-copy-btn, .history-page-open-btn {
    padding: 0.5rem 1rem;
    background: hsl(0 0% 100%);
    color: hsl(240 10% 3.9%);
    border: 1px solid hsl(240 5.9% 90%);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Figtree', sans-serif;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-page-copy-btn:hover, .history-page-open-btn:hover {
    background: hsl(240 4.8% 95.9%);
    border-color: hsl(240 5.9% 70%);
}

/* ------------------------------------------------------------------------- */
/* MOBILE RESPONSIVE DESIGN & "ZOOM OUT APP FEEL"                            */
/* ------------------------------------------------------------------------- */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    body {
        padding: 0;
        display: block;
        background: hsl(240 4.8% 95.9%);
    }

    nav {
        padding: 0.5rem 1rem;
        position: sticky;
        top: 0;
        z-index: 50;
    }

    .nav-content {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }

    .nav-left {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
    }

    .nav-logo {
        font-size: 1.1rem;
    }

    .nav-right {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .user-info {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .user-name {
        display: none;
    }

    .token-display {
        padding: 0.35rem 0.6rem;
        font-size: 0.85rem;
    }

    .history-btn, .admin-btn, .sign-out-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.82rem;
    }

    .container {
        margin: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
        max-width: 100%;
        box-shadow: none;
    }

    .upload-card-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1rem;
    }

    .upload-header-left {
        flex-direction: column;
    }

    .upload-area {
        padding: 1.5rem;
    }

    .button-group button {
        width: 100%;
    }

    .result-section {
        padding: 1rem;
    }

    .doc-page {
        padding: 1rem;
    }

    .doc-page h1 {
        font-size: 1.35rem;
    }

    .history-page-container {
        margin: 0;
        padding: 0;
    }

    .history-page-header {
        margin: 1.5rem 1rem;
    }

    .back-btn {
        position: static;
        margin-bottom: 1rem;
        width: 100%;
        justify-content: center;
    }

    .history-page-card {
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 1.25rem 1rem;
    }

    .history-page-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .history-page-card-actions {
        flex-direction: column;
    }

    .history-page-card-actions button {
        width: 100%;
        justify-content: center;
    }

    .admin-modal-content, .token-modal-content {
        width: 95%;
        margin: 1rem auto;
        padding: 1.25rem;
        max-height: 90vh;
        overflow-y: auto;
    }

    .admin-search {
        flex-direction: column;
    }

    .admin-search button {
        width: 100%;
    }

    .admin-token-input-group {
        flex-direction: column;
    }

    .admin-token-input-group button {
        width: 100%;
    }

    .admin-action-buttons {
        grid-template-columns: 1fr 1fr;
        display: grid;
    }

    .user-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .user-card-select {
        width: 100%;
        text-align: center;
    }
}
