body {
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    font-family: system-ui, -apple-system, sans-serif;
}

.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    min-height: 3rem;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.top-nav .nav-main {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.top-nav .nav-main a {
    padding: 0.5rem 0.75rem;
    color: #374151;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 0.375rem;
}

.top-nav .nav-main a:hover {
    color: #111827;
    background: #f3f4f6;
}

.top-nav .nav-sep {
    width: 1px;
    height: 1.25rem;
    background: #d1d5db;
    margin: 0 0.5rem;
}

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

.top-nav .nav-user .username {
    padding: 0.25rem 0.5rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.top-nav .nav-user a {
    padding: 0.5rem 0.75rem;
    color: #374151;
    text-decoration: none;
    font-size: 0.9rem;
    border-radius: 0.375rem;
}

.top-nav .nav-user a:hover {
    color: #111827;
    background: #f3f4f6;
}

.upload-container {
    position: relative;
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.controls {
    padding: 1rem;
}

.share-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
    cursor: pointer;
}

.choose-file {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
}

.choose-file:hover {
    background: #555;
}

.progress-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0,0,0,0.7);
    opacity: 0;
    z-index: 10;
    border-radius: 0.5rem;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.progress-card:hover .progress-overlay {
    opacity: 1;
    pointer-events: auto;
}

.abort-button {
    border: 0;
    border-radius: 0;
    top: 0;
    left: 0;
    font-weight: bold;
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 11;
    cursor: pointer;
    background: transparent;
    color: #fff;
}

.progress-card {
    position: relative;
    display: block;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
    min-width: 0;
}

.progress-card.complete {
    border-left: 4px solid #22c55e;
}

.progress-card.error {
    border-left: 4px solid #ef4444;
}

.progress-card.error .percent-suffix {
    display: none;
}

.progress-card.error .percent-uploaded {
    font-size: 0.95rem;
}

.progress-card-body {
    padding: 1rem;
    position: relative;
    z-index: 1;
}

.progress-filename {
    font-size: 0.85rem;
    color: #475569;
    font-weight: 500;
    margin-bottom: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-percent-wrap {
    text-align: center;
    margin-bottom: 0.75rem;
}

.progress-percent-wrap .percent-uploaded {
    font-size: 1.75rem;
    font-weight: 700;
    color: #374151;
}

.progress-percent-wrap .percent-suffix {
    font-size: 1rem;
    font-weight: 500;
    color: #6b7280;
    margin-left: 0.125rem;
}

.progress-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-bar-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.progress-bar-label {
    font-size: 0.75rem;
    color: #6b7280;
    min-width: 3.5rem;
}

.progress-bar-track {
    flex: 1 1 0;
    min-width: 60px;
    height: 120px;
    min-height: 120px;
    background: #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.read-percent,
.upload-percent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100%;
    width: 0;
    min-width: 0;
    transition: width 0.2s ease;
    border-radius: 8px;
}

.read-percent {
    background: #fbbf24;
    display: block;
}

.upload-percent {
    background: #22c55e;
    display: block;
}

.complete-actions {
    margin-top: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.download-link {
    font-size: 0.9em;
    margin-right: 0.5rem;
}

.remove-btn,
.retry-btn {
    padding: 0.2rem 0.5rem;
    font-size: 0.85em;
    cursor: pointer;
    border: 1px solid #999;
    border-radius: 4px;
    background: #f5f5f5;
}

.remove-btn:hover,
.retry-btn:hover {
    background: #e0e0e0;
}

.retry-btn {
    margin-left: 0.5rem;
}

.anon-downloads {
    padding: 1rem;
    margin: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
}

.anon-downloads h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    color: #475569;
}

.anon-downloads ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.anon-downloads li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.anon-downloads li a:first-of-type {
    color: #2563eb;
    text-decoration: none;
}

.anon-downloads li a:first-of-type:hover {
    text-decoration: underline;
}

.anon-downloads .anon-remove {
    font-size: 0.8rem;
    color: #64748b;
}

.anon-downloads .anon-remove:hover {
    color: #dc2626;
}

.incomplete-notice {
    padding: 0.5rem 1rem;
    margin: 1rem;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    font-size: 0.9em;
}

.incomplete-notice .incomplete-remove-btn {
    margin-left: 0.5rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.85em;
    background: #dc3545;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
}

.incomplete-notice .incomplete-remove-btn:hover {
    background: #c82333;
    color: #fff;
}

.login-container {
    max-width: 320px;
    margin: 2rem auto;
    padding: 1.5rem;
}

.login-container h1 {
    margin-top: 0;
}

.login-form label {
    display: block;
    margin-top: 1rem;
    font-weight: 500;
}

.login-form input,
.login-form select {
    display: block;
    width: 100%;
    padding: 0.5rem;
    margin-top: 0.25rem;
    font-size: 1rem;
    box-sizing: border-box;
}

.login-form button {
    margin-top: 1.5rem;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
}

.login-form button:hover {
    background: #555;
}

.login-error {
    color: #c00;
    margin: 0.5rem 0;
}

.success {
    color: #0a0;
    margin: 0.5rem 0;
}

.panel-container {
    padding: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

.table th,
.table td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.table th {
    background: #f5f5f5;
}

.table a {
    margin-right: 0.5rem;
}
