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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f6fa;
    color: #2d3436;
    font-size: 14px;
}

/* Top bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: #2d3436;
    color: #fff;
    gap: 16px;
    flex-wrap: wrap;
}

.top-bar h1 {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-input {
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-input label {
    font-size: 12px;
    opacity: 0.8;
}

.user-input input {
    padding: 4px 8px;
    border: 1px solid #636e72;
    border-radius: 4px;
    background: #3d4447;
    color: #fff;
    font-size: 13px;
    width: 180px;
}

.top-bar-center {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-bar-center button {
    padding: 4px 10px;
    border: 1px solid #636e72;
    border-radius: 4px;
    background: #3d4447;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
}

.top-bar-center button:hover {
    background: #525e62;
}

#record-counter {
    font-size: 14px;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

#jump-input {
    width: 50px;
    padding: 4px 6px;
    border: 1px solid #636e72;
    border-radius: 4px;
    background: #3d4447;
    color: #fff;
    font-size: 13px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

#save-status {
    font-size: 12px;
    opacity: 0.8;
}

.btn-primary {
    padding: 6px 16px;
    border: none;
    border-radius: 4px;
    background: #0984e3;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
}

.btn-primary:hover {
    background: #0773c5;
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    background: #dfe6e9;
    border-bottom: 1px solid #b2bec3;
    gap: 16px;
    flex-wrap: wrap;
}

.mode-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mode-toggle label:first-child {
    font-weight: 600;
    font-size: 13px;
}

.radio-label {
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
}

.record-id {
    font-size: 13px;
    color: #636e72;
    font-family: monospace;
}

.viewer-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.viewer-toggle select {
    padding: 3px 6px;
    border: 1px solid #b2bec3;
    border-radius: 4px;
    font-size: 13px;
}

/* Main content */
.main-content {
    display: flex;
    gap: 1px;
    background: #b2bec3;
    height: calc(100vh - 260px);
    min-height: 300px;
}

.report-panel {
    flex: 1;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.panel-header h2 {
    font-size: 14px;
    font-weight: 600;
}

.panel-hint {
    font-size: 11px;
    color: #888;
}

.report-text {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: "SF Mono", "Consolas", "Monaco", monospace;
    font-size: 13px;
    line-height: 1.65;
    word-break: break-word;
}

.report-text.selectable {
    cursor: text;
}

/* Highlights */
.highlight-significant {
    background: #fab1a0;
    border-bottom: 2px solid #e17055;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.highlight-insignificant {
    background: #ffeaa7;
    border-bottom: 2px solid #fdcb6e;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
}

.highlight-significant:hover,
.highlight-insignificant:hover {
    filter: brightness(0.92);
}

/* Bottom section */
.bottom-section {
    display: flex;
    gap: 1px;
    background: #b2bec3;
    border-top: 2px solid #b2bec3;
}

.annotations-panel {
    flex: 2;
    background: #fff;
    padding: 10px 14px;
    max-height: 200px;
    overflow-y: auto;
}

.annotations-panel h3 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}

.assessment-panel {
    flex: 1;
    background: #fff;
    padding: 10px 14px;
}

.assessment-panel h3 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Annotation tabs */
.annotation-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.tab-btn {
    padding: 4px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 12px;
}

.tab-btn.active {
    background: #2d3436;
    color: #fff;
    border-color: #2d3436;
}

/* Annotation list */
.annotation-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.annotation-list.hidden {
    display: none;
}

.annotation-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 12px;
    background: #f8f9fa;
}

.annotation-item .label-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.label-badge.significant {
    background: #fab1a0;
    color: #c0392b;
}

.label-badge.insignificant {
    background: #ffeaa7;
    color: #856404;
}

.annotation-item .ann-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: monospace;
    color: #555;
}

.annotation-item .ann-range {
    color: #888;
    font-size: 11px;
    white-space: nowrap;
}

.annotation-item .btn-delete {
    border: none;
    background: none;
    color: #e17055;
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    line-height: 1;
}

.annotation-item .btn-delete:hover {
    color: #c0392b;
}

.annotation-list .empty-msg {
    color: #999;
    font-size: 12px;
    font-style: italic;
    padding: 4px 0;
}

/* Form */
.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 3px;
    color: #555;
}

.form-group select {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 13px;
}

/* Label popup */
.label-popup {
    position: fixed;
    z-index: 100;
    display: flex;
    gap: 4px;
    padding: 6px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.label-popup.hidden {
    display: none;
}

.label-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.label-btn.significant {
    background: #fab1a0;
    color: #c0392b;
}

.label-btn.significant:hover {
    background: #f08070;
    color: #fff;
}

.label-btn.insignificant {
    background: #ffeaa7;
    color: #856404;
}

.label-btn.insignificant:hover {
    background: #fdd835;
    color: #5a3e00;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    z-index: 200;
    transition: opacity 0.3s;
}

.toast.hidden {
    opacity: 0;
    pointer-events: none;
}

.toast.success {
    background: #00b894;
    color: #fff;
}

.toast.error {
    background: #d63031;
    color: #fff;
}

.toast.warning {
    background: #fdcb6e;
    color: #2d3436;
}

/* Misc */
.hidden {
    display: none !important;
}

::selection {
    background: #74b9ff;
}
