* {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 1rem;
    background: #f4f4f5;
    color: #18181b;
    line-height: 1.5;
}

.container {
    max-width: 760px;
    margin: 0 auto;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
}

header p {
    margin: 0;
    color: #52525b;
}

.logout {
    color: #2563eb;
    text-decoration: none;
    font-size: 0.9rem;
}

.card {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card h2 {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
}

label {
    display: block;
    margin: 0.75rem 0 0.25rem;
    font-size: 0.9rem;
    font-weight: 500;
}

input[type="password"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #d4d4d8;
    border-radius: 0.5rem;
    font: inherit;
}

textarea {
    resize: vertical;
}

button {
    cursor: pointer;
    border: none;
    border-radius: 0.5rem;
    padding: 0.65rem 1rem;
    font: inherit;
    font-weight: 500;
}

button.primary {
    background: #2563eb;
    color: #fff;
    margin-top: 0.75rem;
}

button.primary:hover {
    background: #1d4ed8;
}

button.secondary {
    background: #e4e4e7;
    color: #18181b;
}

button.secondary:hover {
    background: #d4d4d8;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.hint {
    font-size: 0.85rem;
    color: #71717a;
    margin: 0.25rem 0 0;
}

.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0.5rem;
}

.type-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d4d4d8;
    border-radius: 0.5rem;
    cursor: pointer;
}

.type-option input {
    margin: 0;
}

.type-option:has(input:checked) {
    border-color: #2563eb;
    background: #eff6ff;
}

.tabs .tab-bar {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid #e4e4e7;
    margin-bottom: 0.75rem;
}

.tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #71717a;
    padding: 0.5rem 0.25rem;
}

.tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.tab-panel {
    display: none;
}

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

.progress-bar {
    height: 0.75rem;
    background: #e4e4e7;
    border-radius: 999px;
    overflow: hidden;
}

#progress-fill {
    height: 100%;
    width: 0%;
    background: #2563eb;
    transition: width 0.3s ease;
}

#progress-message {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    color: #52525b;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

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

th {
    color: #52525b;
    font-weight: 600;
}

tbody tr:hover {
    background: #fafafa;
}

.copy-row {
    display: flex;
    gap: 0.5rem;
}

.copy-row textarea {
    flex: 1;
}

@media (max-width: 480px) {
    .type-grid {
        grid-template-columns: 1fr;
    }

    .copy-row {
        flex-direction: column;
    }
}
