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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.5;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    padding: 8px 24px;
    display: flex;
    gap: 20px;
    align-items: center;
}

.home-link {
    color: #a50021;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
}

.home-link:hover {
    text-decoration: underline;
}

.topbar-link {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.topbar-link:hover {
    color: #a50021;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.hidden {
    display: none;
}

.loading-content {
    text-align: center;
}

.loading-content p {
    margin-top: 16px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.loading-hint {
    font-size: 14px !important;
    font-weight: normal !important;
    color: #888 !important;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e0e0e0;
    border-top-color: #a50021;
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Session actions in table */
.session-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.container {
    max-width: 700px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.container.wide {
    max-width: 1100px;
}

h1 {
    margin-bottom: 20px;
    color: #a50021;
}

label {
    display: block;
    margin-top: 16px;
    margin-bottom: 4px;
    font-weight: 600;
}

textarea, input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

textarea:focus, input:focus {
    outline: none;
    border-color: #a50021;
}

button, .button {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 28px;
    background: #a50021;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
}

button:hover, .button:hover {
    background: #8a001b;
}

.button.secondary {
    background: #666;
}

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

.error {
    background: #ffeef0;
    border: 1px solid #e0a0a0;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 16px;
    color: #a50021;
}

.hint {
    color: #666;
    margin-bottom: 16px;
}

/* Review table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th, td {
    padding: 8px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f9f9f9;
    font-size: 13px;
    color: #666;
}

.col-num { width: 40px; text-align: center; }
.col-name { width: 180px; }
.col-type { width: 100px; }
.col-reason { }
.col-actions { width: 40px; text-align: center; }

.col-name input[type="text"] {
    font-weight: 600;
}

.btn-delete {
    background: none;
    border: none;
    color: #ccc;
    font-size: 20px;
    cursor: pointer;
    padding: 0 8px;
    margin: 0;
    line-height: 1;
}

.btn-delete:hover {
    color: #a50021;
}

.col-reason textarea {
    width: 100%;
    min-height: 40px;
    resize: vertical;
}

select {
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}


.actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}

.datum-display {
    color: #666;
    font-size: 14px;
}

.datum-picker {
    display: flex;
    align-items: center;
    gap: 8px;
}

.datum-picker label {
    margin: 0;
    font-size: 14px;
}

.datum-picker input[type="date"] {
    width: auto;
    padding: 8px;
}

.file-list {
    margin: 20px 0;
}

.file-list h3 {
    margin-bottom: 8px;
}

.file-list ul {
    list-style: none;
    padding: 0;
}

.file-list li {
    padding: 4px 0;
    font-family: monospace;
    font-size: 13px;
    color: #555;
}

.file-list li::before {
    content: "\2713 ";
    color: #2e7d32;
}

.file-list li a {
    color: #a50021;
    text-decoration: none;
}

.file-list li a:hover {
    text-decoration: underline;
}

/* Preview grid */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin: 20px 0;
}

.preview-card {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.preview-card img {
    width: 100%;
    display: block;
}

.preview-label {
    padding: 8px 12px;
    font-family: monospace;
    font-size: 12px;
    color: #666;
    border-top: 1px solid #e0e0e0;
    background: #f9f9f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.download-link {
    color: #a50021;
    text-decoration: none;
    font-size: 12px;
    white-space: nowrap;
}

.download-link:hover {
    text-decoration: underline;
}

/* Sessions table */
.sessions-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.sessions-table th, .sessions-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
    text-align: left;
}

.sessions-table th {
    background: #f9f9f9;
    font-size: 13px;
    color: #666;
}

.sessions-date {
    font-size: 13px;
    color: #888;
}

.button.small {
    padding: 6px 14px;
    font-size: 13px;
    margin: 0;
}

.sessions-detail {
    font-size: 12px;
    color: #888;
    font-weight: normal;
}

/* Session header with rename */
.session-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.session-header h1 {
    margin-bottom: 0;
}

.rename-form {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rename-input {
    width: 200px;
    padding: 4px 8px;
    font-size: 14px;
}

/* Quote section */
.quote-section {
    margin: 20px 0;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.quote-section summary {
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #666;
}

.quote-section summary:hover {
    color: #a50021;
}

.quote-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 0 14px 14px;
}

.quote-field label {
    margin-top: 0;
    font-size: 13px;
}

.quote-field textarea {
    font-style: italic;
}

.preview-card img {
    cursor: pointer;
}

/* Preview edit layout */
.preview-edit-layout {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.preview-edit-image {
    flex: 1;
    min-width: 0;
}

.preview-edit-image img {
    width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.preview-edit-form {
    flex: 0 0 350px;
}

.preview-edit-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.preview-edit-nav {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}

.no-preview {
    padding: 60px;
    text-align: center;
    color: #999;
    background: #f5f5f5;
    border-radius: 6px;
}

/* Help page */
.help-page section {
    margin-bottom: 32px;
}

.help-page h2 {
    color: #a50021;
    font-size: 20px;
    margin-top: 28px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e0e0e0;
}

.help-page h3 {
    font-size: 16px;
    margin-top: 20px;
    margin-bottom: 8px;
    color: #444;
}

.help-page p {
    margin-bottom: 10px;
}

.help-page ul {
    margin-bottom: 12px;
    padding-left: 24px;
}

.help-page li {
    margin-bottom: 6px;
}

.help-screenshot {
    width: 100%;
    max-width: 700px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin: 16px 0;
    display: block;
}

@media (max-width: 800px) {
    .preview-edit-layout {
        flex-direction: column;
    }
    .preview-edit-form {
        flex: 1;
    }
    .preview-grid {
        grid-template-columns: 1fr;
    }
}
