.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    max-width: 960px;
    margin-bottom: 1.25rem;
}

.page-header h1 {
    margin-bottom: 0.25rem;
}

.page-subtitle {
    margin: 0;
    color: #5f6b7a;
}

.log-form {
    background: #fff;
    border: 1px solid #e6e9ef;
    border-radius: 6px;
    padding: 1.25rem;
    max-width: 960px;
}

.form-grid,
.analysis-grid,
.analysis-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.notebook-panel {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid #e6e9ef;
    border-radius: 6px;
    background: #f7f9fc;
}

.notebook-panel.drop-active {
    border-color: #0070f3;
    background: #f3f8ff;
}

.notes-canvas {
    display: block;
    min-height: 460px;
    padding: 1.5rem;
    border: 1px solid #d8dee9;
    border-radius: 0 0 8px 8px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
    line-height: 1.55;
    outline: none;
    overflow: auto;
}

.notebook-panel .doc-toolbar {
    border-radius: 8px 8px 0 0;
    border-bottom: 0;
}

.notes-canvas p,
.notes-canvas figure {
    margin: 0 0 0.75rem;
}

.notes-canvas h1,
.notes-canvas h2,
.notes-canvas h3 {
    margin: 1rem 0 0.5rem;
}

.notes-canvas blockquote {
    margin: 0.75rem 0;
    padding-left: 1rem;
    border-left: 3px solid #0070f3;
    color: #475569;
}

.notes-canvas p:last-child,
.notes-canvas figure:last-child {
    margin-bottom: 0;
}

.notes-canvas:empty::before {
    color: #94a3b8;
    content: attr(data-placeholder);
}

.notes-canvas.drag-over {
    border-color: #0070f3;
    box-shadow: 0 0 0 3px #d7e7ff;
}

.notes-canvas img {
    display: block;
    max-width: 100%;
    margin: 0.75rem 0;
    border: 1px solid #e6e9ef;
    border-radius: 4px;
}

.notes-canvas table {
    width: 100%;
    margin: 0.75rem 0;
    border-collapse: collapse;
}

.notes-canvas td,
.notes-canvas th {
    min-width: 6rem;
    border: 1px solid #cbd5e1;
    padding: 0.45rem;
}

.attachment-chip {
    display: inline-block;
    margin: 0.25rem 0.35rem 0.25rem 0;
    padding: 0.25rem 0.55rem;
    border: 1px solid #d8dee9;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
}

.btn.ai {
    background: #111827;
    color: #fff;
    border-color: #111827;
    white-space: nowrap;
}

.analysis-panel {
    margin-top: 1.25rem;
    padding: 1rem;
    border: 1px solid #d8dee9;
    border-radius: 6px;
    background: #f8fafc;
}

.materials-panel {
    margin-top: 1.25rem;
    padding: 1rem;
    border: 1px solid #e6e9ef;
    border-radius: 6px;
    background: #fff;
}

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

.materials-header h2 {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
}

.materials-header p {
    margin: 0;
    color: #5f6b7a;
}

.materials-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) 0.7fr 0.6fr minmax(0, 1fr) max-content;
    gap: 0.75rem;
}

.material-usage-list {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.material-usage-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 0.75rem;
    align-items: center;
    border: 1px solid #e6e9ef;
    border-radius: 6px;
    padding: 0.65rem;
    background: #fbfcfe;
}

.material-usage-item p {
    margin: 0.2rem 0 0;
    color: #5f6b7a;
}

.upload-note {
    margin: 0.35rem 0 0;
    color: #5f6b7a;
    font-size: 0.95rem;
}

.selected-files {
    margin: 0.75rem 0 0;
    padding-left: 1.25rem;
}

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

.analysis-header h2 {
    margin: 0;
    font-size: 1.15rem;
}

.vip-badge {
    border: 1px solid #0f766e;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    color: #0f766e;
    font-size: 0.8rem;
    font-weight: 700;
}

.analysis-text {
    min-height: 180px;
    resize: vertical;
}

.analysis-columns h3 {
    margin: 0.75rem 0 0.35rem;
    font-size: 1rem;
}

.analysis-columns ul {
    min-height: 4rem;
    margin: 0;
    padding-left: 1.25rem;
}

.confirm-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-weight: 600;
}

.confirm-row input {
    width: auto;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.form-status {
    min-height: 1.25rem;
    margin: 0.75rem 0 0;
    color: #256029;
}

.form-status.error {
    color: #b00020;
}

@media (max-width: 760px) {
    .page-header,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .form-grid,
    .analysis-grid,
    .materials-grid,
    .analysis-columns {
        grid-template-columns: 1fr;
    }

    .materials-header,
    .material-usage-item {
        grid-template-columns: 1fr;
        flex-direction: column;
    }
}
