body {
    overflow: auto;
    position: static;
    width: auto;
    background: #f4f6f8;
}

.conversation-note-page {
    max-width: 1180px;
    margin: 32px auto 70px auto;
    padding: 30px;
    font-family: Arial, sans-serif;
    color: #1f2937;
    background: rgba(255, 255, 255, 0.55);
    border: 2px solid #1f2937;
    border-radius: 28px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(12px);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 24px 28px;
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.10);
    border: 2px solid #1f2937;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
}

.note-title h1 {
    margin: 0 0 8px 0;
    font-size: 30px;
    font-weight: 800;
}

.note-title p {
    margin: 0;
    color: #64748b;
    line-height: 1.5;
}

.back-map-btn {
    display: inline-block;
    padding: 11px 16px;
    border-radius: 10px;
    background: #111827;
    color: white;
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
}

.back-map-btn:hover {
    background: #374151;
}

.note-count-pill {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-weight: 800;
    font-size: 13px;
}

.note-card {
    background: rgba(255, 255, 255, 0.92);
    border: 2px solid #1f2937;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.22);
    margin-bottom: 22px;
    overflow: hidden;
}

.note-summary-row {
    padding: 22px 24px;
    display: grid;
    grid-template-columns: 1.4fr 0.7fr 0.8fr 0.4fr;
    gap: 16px;
    align-items: center;
    border-bottom: 2px solid #1f2937;
    background: rgba(248, 250, 252, 0.95);
}

.conversation-summary-row {
    grid-template-columns: 1.4fr 0.6fr 0.5fr 0.8fr 120px;
}

.conversation-summary-row > div:last-child {
    justify-self: end;
}

.conversation-title {
    font-size: 19px;
    font-weight: 800;
    margin-bottom: 6px;
    color: #0f172a;
}

.meta-label {
    display: block;
    color: #475569;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    font-weight: 800;
}

.meta-value {
    font-size: 15px;
    color: #111827;
    font-weight: 700;
}

details.note-details {
    padding: 0;
}

details.note-details > summary {
    cursor: pointer;
    padding: 15px 24px;
    font-weight: 800;
    color: #2563eb;
    list-style: none;
    border-bottom: 1px solid #cbd5e1;
}

details.note-details > summary::-webkit-details-marker {
    display: none;
}

details.note-details > summary::after {
    content: "Show summary and history";
}

details.note-details[open] > summary::after {
    content: "Hide summary and history";
}

.note-body {
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 24px;
}

.generic-note-body,
.score-note-body {
    grid-template-columns: 1fr 1fr;
}

.section-box {
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.94);
}

.section-box h2 {
    margin: 0 0 14px 0;
    font-size: 18px;
    color: #0f172a;
}

.summary-text {
    white-space: pre-wrap;
    line-height: 1.7;
    color: #243042;
    font-size: 15px;
}

.empty-note,
.empty-chat {
    padding: 28px;
    text-align: center;
    color: #64748b;
    background: rgba(255, 255, 255, 0.92);
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
}

.chat-history {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 560px;
    overflow-y: auto;
    padding-right: 6px;
}

.chat-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 8px;
}

.chat-label {
    font-weight: 800;
    font-size: 13px;
    color: #475569;
}

.chat-npc {
    align-items: flex-start;
}

.chat-npc .chat-bubble {
    background: #e0f2fe;
    color: #075985;
    border-radius: 14px 14px 14px 4px;
}

.chat-player {
    align-items: flex-end;
}

.chat-player .chat-label {
    text-align: right;
}

.chat-player .chat-bubble {
    background: #dcfce7;
    color: #166534;
    border-radius: 14px 14px 4px 14px;
}

.chat-bubble {
    padding: 12px 14px;
    line-height: 1.55;
    font-size: 15px;
    max-width: 70%;
    word-break: break-word;
    white-space: normal;
}

.delete-note-btn {
    display: inline-block;
    background: #ef4444;
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
}

.delete-note-btn:hover {
    background: #dc2626;
}

.json-box {
    max-height: 430px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    font-size: 13px;
    line-height: 1.5;
}

.big-score {
    font-size: 44px;
    font-weight: 900;
    color: #2563eb;
}

body.dark-mode,
.dark body {
    background: #111827 !important;
    color: #e5e7eb !important;
}

body.dark-mode .conversation-note-page,
.dark .conversation-note-page {
    background: rgba(31, 41, 55, 0.88) !important;
    border: 2px solid #d1d5db !important;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.55) !important;
}

body.dark-mode .note-header,
.dark .note-header {
    background: rgba(17, 24, 39, 0.88) !important;
    border: 2px solid #d1d5db !important;
}

body.dark-mode .note-title h1,
.dark .note-title h1 {
    color: #f9fafb !important;
}

body.dark-mode .note-title p,
.dark .note-title p {
    color: #cbd5e1 !important;
}

body.dark-mode .note-count-pill,
.dark .note-count-pill {
    background: rgba(224, 242, 254, 0.95) !important;
    color: #075985 !important;
}

body.dark-mode .note-card,
.dark .note-card {
    background: rgba(31, 41, 55, 0.92) !important;
    border: 2px solid #d1d5db !important;
}

body.dark-mode .note-summary-row,
.dark .note-summary-row {
    background: rgba(17, 24, 39, 0.94) !important;
    border-bottom: 2px solid #d1d5db !important;
}

body.dark-mode details.note-details > summary,
.dark details.note-details > summary {
    border-bottom: 1px solid #4b5563 !important;
    color: #60a5fa !important;
}

body.dark-mode .conversation-title,
body.dark-mode .meta-value,
body.dark-mode .section-box h2,
.dark .conversation-title,
.dark .meta-value,
.dark .section-box h2 {
    color: #f9fafb !important;
}

body.dark-mode .meta-label,
body.dark-mode .chat-label,
.dark .meta-label,
.dark .chat-label {
    color: #cbd5e1 !important;
}

body.dark-mode .section-box,
.dark .section-box {
    background: rgba(30, 41, 59, 0.9) !important;
    border-color: #d1d5db !important;
}

body.dark-mode .summary-text,
.dark .summary-text {
    color: #e5e7eb !important;
}

body.dark-mode .empty-note,
body.dark-mode .empty-chat,
.dark .empty-note,
.dark .empty-chat {
    background: rgba(30, 41, 59, 0.88) !important;
    border-color: #d1d5db !important;
    color: #d1d5db !important;
}

body.dark-mode .json-box,
.dark .json-box {
    background: #111827 !important;
    border-color: #4b5563 !important;
    color: #e5e7eb !important;
}

body.dark-mode .chat-npc .chat-bubble,
.dark .chat-npc .chat-bubble {
    background: #1e3a5f !important;
    color: #dbeafe !important;
}

body.dark-mode .chat-player .chat-bubble,
.dark .chat-player .chat-bubble {
    background: #14532d !important;
    color: #dcfce7 !important;
}

@media (max-width: 850px) {
    .note-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .note-summary-row,
    .conversation-summary-row,
    .note-body,
    .generic-note-body,
    .score-note-body {
        grid-template-columns: 1fr;
    }
}


/* inverse back button in dark mode */
body.dark-mode .back-map-btn,
.dark .back-map-btn {
    background: #f9fafb !important;
    color: #111827 !important;
    border: 2px solid #111827 !important;
}

body.dark-mode .back-map-btn:hover,
.dark .back-map-btn:hover {
    background: #e5e7eb !important;
}





























.quest-result-box{
    margin-top:24px;
    border:1px solid #ddd;
    border-radius:10px;
    background:#f7f7f7;
    box-shadow:inset 0 1px 2px rgba(0,0,0,0.08);
    overflow:hidden;
}

.quest-result-actions{
    padding:12px;
    text-align:left;
    border-bottom:1px solid #ddd;
    background:#f7f7f7;
}

.quest-result-header{
    padding:12px 16px;
    font-size:20px;
    font-weight:800;
    color:inherit;
    border-bottom:1px solid #444;
}

.quest-result-body{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:14px;
    padding:14px;
    background:#fff;
}

.quest-result-card{
    border:1px solid #e5e7eb;
    border-radius:10px;
    background:#fff;
    overflow:hidden;
}

.quest-result-card-title{
    padding:10px;
    font-weight:bold;
    border-bottom:1px solid #e5e7eb;
    background:#f8fafc;
    text-align:center;
}

.quest-result-scroll{
    height:260px;
    overflow-y:auto;
    padding:14px;
    line-height:1.6;
    color:#111;
    white-space:pre-wrap;
    text-align:left;
    background:#fff;
}

.quest-chat-scroll{
    height:260px;
    overflow-y:auto;
    padding:14px;
    background:#fff;
}

.quest-chat-label{
    font-weight:bold;
    font-size:13px;
    color:#374151;
    margin-bottom:5px;
}

.quest-result-footer{
    padding:18px;
    text-align:center;
}

.dark .quest-result-box{
    background:#1f1f1f !important;
    border-color:#444 !important;
}

.dark .quest-result-actions{
    background:#252525 !important;
    border-bottom-color:#444 !important;
}

.dark .quest-result-body{
    background:#1f1f1f !important;
}

.dark .quest-result-card{
    background:#2b2b2b !important;
    border-color:#444 !important;
}

.dark .quest-result-card-title{
    background:#222 !important;
    color:#f3f4f6 !important;
    border-bottom-color:#444 !important;
}

.dark .quest-result-scroll,
.dark .quest-chat-scroll{
    background:#2b2b2b !important;
    color:#f3f4f6 !important;
}

.dark .quest-chat-label{
    color:#f3f4f6 !important;
}