@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Geist:wght@400;500;600;700&family=JetBrains+Mono&display=swap');

:root {
    --primary: #004ac6;
    --primary-light: rgba(0, 74, 198, 0.08);
    --bg: #faf8ff;
    --text: #131b2e;
    --text-muted: #5e6687;
    --sidebar-bg: #eaedff;
    --border: rgba(0, 0, 0, 0.05);
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Geist', sans-serif;
    --font-mono: 'JetBrains Mono', Consolas, Menlo, 'Malgun Gothic', '맑은 고딕', 'Apple SD Gothic Neo', monospace;
    --sidebar-width: 280px;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-sans);
    color: var(--text);
    background-color: var(--bg);
    margin: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Layout */
#editorial-container {
    display: flex;
    min-height: 100vh;
}

#editorial-sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: 2rem 1.5rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

#editorial-sidebar h3 {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

#editorial-main {
    flex: 1;
    padding: 4rem 10%;
    max-width: 1100px;
}

article.document {
    max-width: 720px;
    margin: 0 auto;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.25;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Code blocks */
pre, code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: #f1f1f1;
    border-radius: 4px;
}

pre { padding: 1rem; overflow-x: auto; }

/* --- MsgID Interaction Core --- */
[data-msgid] {
    position: relative;
    border-radius: 2px;
}

/* Breadcrumbs */
.editorial-breadcrumbs {
    margin-bottom: 2rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumbs {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.breadcrumbs li {
    display: flex;
    align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
    content: "/";
    margin-left: 0.5rem;
    opacity: 0.3;
}

.breadcrumbs a {
    color: var(--text-muted);
}

.breadcrumbs a:hover {
    color: var(--primary);
}

.breadcrumbs li.current {
    font-weight: 500;
    color: var(--text);
}

/* Sidebar Search */
#searchbox input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s;
}

#searchbox input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Tooltip (Toast) */
#editorial-tooltip {
    position: fixed;
    bottom: 24px;
    left: 50%;
    opacity: 0; pointer-events: none; transform: translateY(calc(100% + 40px)) translateX(-50%);
    background-color: var(--text);
    color: white;
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 13px;
    font-family: var(--font-mono);
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: pre-wrap;
    max-width: 80%;
}

#editorial-tooltip.visible {
    opacity: 1;
    transform: translateY(0) translateX(-50%);
}

/* Admonitions (Call-outs) */
.admonition {
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
    border-left: 4px solid var(--primary);
    background-color: rgba(0, 74, 198, 0.03);
    border-radius: 0 8px 8px 0;
}

.admonition .admonition-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.admonition.warning {
    border-left-color: #d93025;
    background-color: rgba(217, 48, 37, 0.03);
}

.admonition.warning .admonition-title {
    color: #d93025;
}

.admonition p:last-child {
    margin-bottom: 0;
}

/* Tables */
table.docutils {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

table.docutils th, table.docutils td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

table.docutils th {
    background-color: var(--sidebar-bg);
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text);
    border-bottom: 2px solid var(--primary);
}

table.docutils tr:last-child td {
    border-bottom: none;
}

/* Footnote Markers (Dynamic Visibility) */
.editorial-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    margin-left: 0.3rem;
    vertical-align: super;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    
    /* Hidden by default */
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.2s ease;
    pointer-events: none; /* Prevent accidental clicks when hidden */
}

/* Show on hover of the parent sentence */
[data-msgid]:hover .editorial-marker {
    opacity: 1;
    pointer-events: auto;
}

/* Initial flash class to show markers temporarily on load */
.editorial-marker.flash {
    opacity: 0.6;
}

.editorial-marker:hover {
    transform: scale(1.2);
    opacity: 1 !important;
}

/* Bottom Footnote Section */
#editorial-footnotes {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px solid var(--primary);
}

.editorial-highlight {
    background-color: #fff59d !important;
    transition: background-color 0.5s ease-out;
}

.footnote-item {
    margin-bottom: 2rem;
    border-radius: 16px;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.footnote-item:not(.collapsed):focus-within {
    box-shadow: 0 8px 30px rgba(0, 74, 198, 0.08);
}

.footnote-header {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    cursor: pointer;
    background: #fff;
    user-select: none;
}

.footnote-header:hover {
    background: #f8f9ff;
}

.header-summary {
    flex: 1;
    margin-left: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.toggle-icon {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footnote-body {
    padding: 0 1.5rem 1.5rem;
    border-top: 1px solid var(--border);
    display: block;
}
.footnote-body {
    padding: 0 1rem 1rem;
    border-top: 1px solid var(--border);
    display: block;
}

/* Restore Collapse Logic */
.footnote-item.collapsed .footnote-body {
    display: none;
}

.filter-bar {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    padding-bottom: 1rem;
    border-bottom: 1px dashed var(--border);
}

.filter-btn {
    background: none;
    border: 1px solid var(--border);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.interaction-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0 1.25rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sort-controls {
    display: flex;
    gap: 0.25rem;
    background: #f1f3f9;
    padding: 0.25rem;
    border-radius: 8px;
}

.sort-btn {
    background: none;
    border: none;
    padding: 0.3rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.sort-btn:hover {
    color: var(--primary);
}

.sort-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.interaction-content {
    min-height: 50px;
}

.item-entry {
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.item-entry:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.item-header-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.item-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.meta-top {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.author-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text);
}

.meta-details {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.item-actions-compact {
    display: flex;
    gap: 0.4rem;
}

.vote-btn-compact {
    background: #f8f9ff;
    border: 1px solid #eef0ff;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
}

.vote-btn-compact:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.vote-btn-compact.voted {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
}

.action-icon-btn {
    background: none;
    border: 1px solid transparent;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}

.action-icon-btn:hover {
    background: #f1f3f9;
    color: var(--primary);
}

.item-body-compact {
    padding-left: 33px; /* Align with meta text */
}

.item-body-compact .code-block {
    margin: 0 !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.8rem !important;
    background: #fcfcfd !important;
    border: 1px solid #f0f0f0 !important;
}

.item-note-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    padding-left: 0.5rem;
    border-left: 2px solid #eee;
    font-style: italic;
}

.note-actions {
    display: inline-flex;
    gap: 6px;
    margin-left: 10px;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.item-note-caption:hover .note-actions {
    opacity: 1;
}

.empty-note-author {
    border-left: none !important;
    padding-left: 0 !important;
    margin-top: 0.2rem;
    min-height: 20px;
}

.empty-note-author .note-actions.always-visible {
    opacity: 0.35;
    margin-left: 0;
}

.empty-note-author:hover .note-actions.always-visible {
    opacity: 1;
}

.note-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.75rem;
    border-radius: 4px;
    transition: background-color 0.2s, transform 0.1s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.note-action-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

.note-action-btn:active {
    transform: scale(0.95);
}

.author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

.author-avatar.placeholder {
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.meta-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    color: var(--text);
    font-size: 0.85rem;
}

.meta-details {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ai-badge {
    background: #f0f2ff;
    color: var(--primary);
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 700;
    margin-left: 0.4rem;
    border: 1px solid var(--primary-light);
    vertical-align: middle;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.status-badge.success { 
    background: #e6f4ea;
    color: #1e7e34;
}
.status-badge.error { 
    background: #fce8e6;
    color: #d93025;
}
.status-badge.pending { 
    background: #fff4e5;
    color: #b05a00;
}

.item-entry.is-ai {
    background: rgba(0, 74, 198, 0.01); /* Very subtle tint for AI suggestions */
}

.item-entry.suggestion.is-published {
    border: 1.5px dashed rgba(46, 125, 50, 0.35);
    background: rgba(46, 125, 50, 0.012);
    box-shadow: 0 4px 10px rgba(46, 125, 50, 0.02);
}

.item-entry.suggestion.is-published:hover {
    border-color: rgba(46, 125, 50, 0.55);
    box-shadow: 0 6px 15px rgba(46, 125, 50, 0.05);
}

#editorial-footnotes pre[class*="language-"],
#editorial-footnotes code[class*="language-"],
#editorial-footnotes .code-block,
#editorial-sidebar-panel pre[class*="language-"],
#editorial-sidebar-panel code[class*="language-"],
#editorial-sidebar-panel .code-block {
    white-space: pre-wrap !important;
    word-break: break-all !important;
    overflow-wrap: break-word !important;
}

#editorial-footnotes .code-block,
#editorial-footnotes pre[class*="language-"],
#editorial-sidebar-panel .code-block,
#editorial-sidebar-panel pre[class*="language-"] {
    background: #f4f4f4;
    border-radius: 6px;
    padding: 1rem;
    margin: 0.5rem 0;
    border: 1px solid #ddd;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
}

.code-block code {
    background: none;
    padding: 0;
    color: #333;
}

.item-text {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

/* User Note in List v4 */
/* User Note in List v10 */
.item-note {
    background: transparent !important;
    padding: 0.2rem 0 0.5rem 1.2rem !important;
    border-left: 2px solid var(--primary-light) !important;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.5rem;
}

.item-votes {
    margin-top: 1rem;
}

.vote-btn {
    background: white;
    border: 1px solid var(--border);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.vote-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.vote-btn.voted {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
    box-shadow: 0 4px 10px rgba(0, 74, 198, 0.2);
}

.item-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #f8f9fb;
}

.secondary-actions {
    display: flex;
    gap: 0.5rem;
}

.action-link-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.action-link-btn:hover {
    background: #f1f3f9;
    color: var(--primary);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.action-btn {
    flex: 1;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #f0f2ff;
    border-color: var(--primary);
}

.action-btn.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
}

.action-btn.btn-primary:hover {
    background: #003da3;
}

/* Unified Editor v2 (Flat) */
.unified-editor {
    margin-top: 1rem;
    padding: 0;
}

.editor-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text);
}

/* English Reference (Original) v5 */
.msgid-ref {
    margin-bottom: 1.25rem;
}

.ref-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.msgid-ref-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.msgid-ref-header .ref-label {
    margin-bottom: 0;
}

.btn-copy-ref {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
}

.btn-copy-ref:hover {
    background: var(--primary-light, rgba(230, 244, 255, 0.4));
    border-color: var(--primary);
}

/* Gutter & Line-by-Line layout for MSGID Reference */
.msgid-lines-container {
    display: flex;
    flex-direction: column;
    background: #f1f3f9;
    border-left: 4px solid #ced4da;
    border-radius: 4px;
    overflow: hidden;
    padding: 0.5rem 0;
}

.msgid-line {
    display: flex;
    align-items: flex-start;
    width: 100%;
}

.msgid-line-num {
    width: 2.25rem;
    min-width: 2.25rem;
    text-align: right;
    padding-right: 8px;
    box-sizing: border-box;
    font-family: var(--font-mono) !important;
    font-size: 0.85rem !important;
    line-height: 1.5 !important;
    color: #a0aec0;
    user-select: none;
    margin-top: 0.15rem; /* Slight shift to align baseline with code */
}

.msgid-line-code {
    margin: 0 !important;
    padding: 0 1rem 0 0.5rem !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    flex-grow: 1;
    font-size: 0.85rem !important;
    line-height: 1.5 !important;
    font-family: var(--font-mono) !important;
    white-space: pre-wrap !important;
    word-break: break-all !important;
    overflow-wrap: break-word !important;
}

.msgid-line-code code {
    background: transparent !important;
    padding: 0 !important;
    color: #495057 !important;
}

/* Line Number Gutters */
.editor-container {
    position: relative;
    width: 100%;
}

/* Live Editor v11 - Complete Symmetry & Isolation */

/* 
  Use strong ID + Class + Tag selectors to override any external pre[class*="language-"] styles.
  Forces exact structural alignment down to 1px between the text input and code highlight layers.
*/
#editorial-footnotes textarea.msgstr-textarea,
#editorial-footnotes pre.highlight-layer {
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 1rem !important;
    font-family: var(--font-mono) !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    border: none !important;
    outline: none !important;
    border-radius: 0 !important;
    width: 100% !important;
    min-height: 100px !important;
    white-space: pre-wrap !important;
    word-break: break-all !important;
    overflow-wrap: break-word !important;
    text-align: left !important;
    background: transparent !important;
}

#editorial-sidebar-panel textarea.msgstr-textarea,
#editorial-sidebar-panel pre.highlight-layer {
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 1rem 1rem 1rem 2.75rem !important;
    font-family: var(--font-mono) !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    border: none !important;
    outline: none !important;
    border-radius: 0 !important;
    width: 100% !important;
    min-height: 100px !important;
    white-space: pre-wrap !important;
    word-break: break-all !important;
    overflow-wrap: break-word !important;
    text-align: left !important;
    background: transparent !important;
}

#editorial-sidebar-panel textarea.msgstr-textarea {
    overflow-x: hidden !important;
}

#editorial-sidebar-panel pre.highlight-layer {
    overflow-x: hidden !important;
}

/* Live Editor Line-by-Line Highlight Layer with Gutter */
#editorial-sidebar-panel pre.highlight-layer code {
    display: block;
    width: 100%;
}

.highlight-line {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    display: block;
    white-space: pre-wrap !important;
    word-break: break-all !important;
    overflow-wrap: break-word !important;
}

.highlight-line::before {
    content: attr(data-line);
    position: absolute;
    left: -2.75rem; /* Positions it back in the gutter padding area */
    top: 0;
    width: 2.25rem;
    text-align: right;
    color: #a0aec0;
    font-family: var(--font-mono) !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    user-select: none;
    pointer-events: none;
    border-right: 1px solid var(--border);
    padding-right: 8px;
    box-sizing: border-box;
}

#editorial-footnotes textarea.msgstr-textarea,
#editorial-sidebar-panel textarea.msgstr-textarea {
    position: relative;
    z-index: 2;
    color: transparent !important; /* Hides raw text, rendering caret only */
    caret-color: var(--text) !important;
    resize: vertical;
    overflow-y: hidden;
}

#editorial-footnotes pre.highlight-layer,
#editorial-sidebar-panel pre.highlight-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
    color: #333;
    overflow: hidden;
    box-shadow: none !important;
}

#editorial-footnotes pre.highlight-layer code,
#editorial-sidebar-panel pre.highlight-layer code {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
    white-space: pre-wrap !important;
    word-break: break-all !important;
    overflow-wrap: break-word !important;
}

/* Ensure editor container background is the base */
.editor-container {
    position: relative;
    width: 100%;
    background: white;
    border: none;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s;
}

/* Editor Header & Guide Button */
.editor-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.guide-btn {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(0, 74, 198, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.guide-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 74, 198, 0.2);
}

/* Modal System (Premium) */
.editorial-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}

.editorial-modal.visible {
    opacity: 1; pointer-events: auto;
}

.modal-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(19, 27, 46, 0.4);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.editorial-modal.visible .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1.5rem; right: 1.5rem;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.05);
    border: none;
    font-size: 1.5rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #ff4d4d;
    color: white;
}

.modal-body {
    padding: 3rem;
    overflow-y: auto;
    flex: 1;
}

/* Modal Markdown Content */
.markdown-content h1 { font-size: 1.75rem; margin-top: 0; border-bottom: 2px solid var(--primary-light); padding-bottom: 0.5rem; }
.markdown-content h2 { font-size: 1.25rem; margin-top: 2rem; color: var(--primary); }
.markdown-content p { margin: 1rem 0; color: #4a5568; }
.markdown-content ul { padding-left: 1.5rem; margin: 0.75rem 0; }
.markdown-content li { margin-bottom: 0.2rem; color: #4a5568; line-height: 1.5; }
.markdown-content ul ul { margin-top: 0.25rem; margin-bottom: 0.75rem; padding-left: 1.25rem; list-style-type: circle; }
.markdown-content ul ul li { margin-bottom: 0.1rem; font-size: 0.9em; color: #718096; }
.markdown-content code { background: #f1f3f9; color: var(--primary); padding: 0.2rem 0.4rem; border-radius: 4px; font-size: 0.9em; }
.markdown-content pre.code-block { background: #1a202c !important; color: #e2e8f0 !important; border: none !important; }
.markdown-content pre.code-block code { background: transparent; color: inherit; padding: 0; }

.unified-input-group {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: white;
    transition: all 0.2s;
}

.unified-input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 74, 198, 0.08);
}

/* Move focus effect to group */

.editor-container.disabled {
    background: #f1f3f9;
    opacity: 0.7;
    cursor: not-allowed;
}

.msgstr-textarea, .note-textarea {
    overflow-x: hidden !important;
}

.msgstr-textarea:disabled, .note-textarea:disabled {
    cursor: not-allowed;
    background: transparent;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
}

.msgstr-textarea:focus {
    outline: none !important;
    box-shadow: none !important;
    border-color: transparent !important;
}

/* Merged and fully isolated in the primary Live Editor definition above */

.note-textarea {
    width: 100%;
    min-height: 42px;
    padding: 0.5rem 1rem;
    background: #fafafa;
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    line-height: 1.5;
    transition: all 0.2s;
    resize: vertical;
}

.msgstr-textarea:focus, .note-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 74, 198, 0.05);
}

.comment-section {
    margin-top: 1rem;
}

.markdown-preview {
    padding: 1rem;
    min-height: 100px;
    font-size: 0.95rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-submit {
    background: var(--primary);
    color: white !important;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 2px 5px rgba(0, 74, 198, 0.2);
}

.btn-submit:hover {
    background: #003da3;
}

.btn-submit:active {
    transform: translateY(1px);
}

.btn-cancel {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 500;
}

/* Auth UI */
.login-required-box {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    border: 1px dashed #dee2e6;
}

.login-required-box p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.github-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #24292f;
    color: white !important;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none !important;
    transition: background 0.2s;
}

.github-login-btn:hover {
    background: #000;
}

.vote-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Error Log Display Styles */
.error-log-container {
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

.error-details {
    background: #fff8f8;
    border: 1px solid #ffd8d8;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
}

.error-summary {
    cursor: pointer;
    font-weight: 600;
    color: #cc2222;
    outline: none;
    user-select: none;
}

.error-summary:hover {
    color: #990000;
}

.error-pre {
    margin: 0.5rem 0 0 0;
    padding: 0.6rem;
    background: #1e1e24;
    color: #fca5a5;
    border-radius: 4px;
    overflow-x: auto;
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    white-space: pre-wrap;
    border: 1px solid #fda4af33;
}

/* Inline Note Editor (Premium UX) */
.item-note-caption.editing {
    border-left: none !important;
    padding-left: 0 !important;
    margin-top: 0.6rem !important;
    font-style: normal !important;
    display: block !important;
}

.inline-note-editor {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    background: #fcfdfe;
    border: 1px solid rgba(0, 74, 198, 0.15);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(0, 74, 198, 0.03) inset;
}

.inline-note-textarea {
    width: 100%;
    min-height: 50px;
    border: none !important;
    background: transparent !important;
    outline: none !important;
    resize: none;
    font-family: var(--font-sans) !important;
    font-size: 0.825rem !important;
    line-height: 1.5 !important;
    color: var(--text) !important;
    padding: 4px !important;
    margin: 0 !important;
}

.inline-note-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.inline-btn {
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    padding: 4px 10px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
    border: 1px solid transparent !important;
}

.inline-save-btn {
    background: var(--primary) !important;
    color: white !important;
}

.inline-save-btn:hover {
    background: #003da3 !important;
    transform: translateY(-1px);
}

.inline-cancel-btn {
    background: #f1f3f9 !important;
    color: var(--text-muted) !important;
    border-color: var(--border) !important;
}

.inline-cancel-btn:hover {
    background: #eef0ff !important;
    color: var(--primary) !important;
}

/* --- Sliding Sidebar Translation Panel --- */
#editorial-sidebar-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 720px;
    max-width: 95vw;
    height: 100vh;
    background: #ffffff;
    box-shadow: -10px 0 40px rgba(19, 27, 46, 0.15);
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    font-family: var(--font-sans);
}

#editorial-sidebar-panel.resizing {
    transition: none !important;
}

/* Sidebar Resizer Handle */
.sidebar-resizer {
    position: absolute;
    left: -3px; /* Center hover/grab area slightly over the boundary edge */
    top: 0;
    width: 8px; /* High-touch target for easier grab */
    height: 100%;
    cursor: col-resize;
    z-index: 10005;
    background: transparent;
    transition: background 0.2s ease;
}

.sidebar-resizer:hover,
#editorial-sidebar-panel.resizing .sidebar-resizer {
    background: rgba(0, 74, 198, 0.25); /* Sleek translucent primary color brand accent */
}

#editorial-sidebar-panel.visible {
    transform: translateX(0);
}

/* Glassmorphic Backdrop Overlay */
#editorial-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(19, 27, 46, 0.25);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#editorial-sidebar-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Sidebar Panel Header */
.sidebar-panel-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #faf8ff;
}

.panel-header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.panel-header-title h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    font-family: var(--font-heading);
}

.panel-marker-badge {
    background: var(--primary);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 74, 198, 0.25);
}

.panel-marker-badge:hover {
    transform: scale(1.08);
}

.panel-close-btn {
    background: none;
    border: none;
    font-size: 1.75rem;
    font-weight: 300;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.panel-close-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text);
}

/* Sidebar Panel Body */
.sidebar-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Floating Trigger Button */
#editorial-floating-trigger {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%) translateX(0);
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px 0 0 8px;
    padding: 14px 10px;
    cursor: pointer;
    z-index: 9998;
    writing-mode: vertical-rl;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    box-shadow: -4px 0 16px rgba(0, 74, 198, 0.2);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s, background 0.2s;
}

#editorial-floating-trigger:hover {
    padding-right: 14px;
    background: #003fa8;
    box-shadow: -6px 0 20px rgba(0, 74, 198, 0.3);
}

/* Slide out when sidebar is open */
#editorial-sidebar-panel.visible ~ #editorial-floating-trigger {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(100%);
}

/* Sidebar No Selection State */
.sidebar-no-selection-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 1.5rem;
    height: 100%;
}

.no-selection-icon {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
    animation: floatIcon 3s infinite ease-in-out;
}

@keyframes floatIcon {
    0% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0); }
}

.sidebar-no-selection-container h4 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    font-family: var(--font-heading);
}

.sidebar-no-selection-container p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 340px;
    margin: 0 auto;
}

/* --- Premium Tab Layout System --- */
.panel-tabs {
    display: flex;
    gap: 1.75rem;
    align-items: center;
}

.panel-tab-btn {
    background: none;
    border: none;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem 0;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s, font-weight 0.2s;
    outline: none;
}

.panel-tab-btn:hover {
    color: var(--text);
}

.panel-tab-btn.active {
    color: var(--primary);
    font-weight: 600;
}

.panel-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1.35rem; /* Meets border-bottom perfectly */
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary);
    border-radius: 2px 2px 0 0;
}

.panel-tab-btn .panel-marker-badge {
    width: 1.3rem;
    height: 1.3rem;
    font-size: 0.7rem;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 74, 198, 0.2);
}

/* Tab Pane Toggle */
.tab-pane {
    display: none;
    height: 100%;
}

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

/* Guide Markdown inside Tab Wrapper */
.guide-tab-wrapper {
    padding: 0.5rem 0 2rem 0;
    line-height: 1.7;
    color: var(--text);
}

.guide-tab-wrapper h1, 
.guide-tab-wrapper h2, 
.guide-tab-wrapper h3 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.guide-tab-wrapper h1 {
    font-size: 1.4rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.guide-tab-wrapper h2 {
    font-size: 1.2rem;
}

.guide-tab-wrapper h3 {
    font-size: 1.05rem;
}

.guide-tab-wrapper p {
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text);
}

.guide-tab-wrapper ul {
    margin-bottom: 1.25rem;
    padding-left: 1.25rem;
    list-style-type: disc;
}

.guide-tab-wrapper li {
    margin-bottom: 0.2rem;
    font-size: 0.9rem;
    color: var(--text);
}

/* Lost and Found (분실물 보관소) */
.lost-and-found-section {
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.lost-and-found-section h4 {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 0;
    margin-bottom: 1rem;
}

.lost-and-found-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    background: rgba(0, 74, 198, 0.02);
    border: 1px dashed rgba(0, 74, 198, 0.15);
    border-radius: 8px;
    padding: 1rem;
}

.lost-and-found-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
}

.lost-and-found-item:hover .editorial-marker {
    transform: scale(1.15);
}

.lost-and-found-item .editorial-marker {
    opacity: 1 !important;
    pointer-events: auto !important;
    vertical-align: middle !important;
    margin: 0 !important;
    display: inline-flex !important;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease !important;
}

/* Custom glowing red highlight rules for Lost & Found circular badges */
.lost-and-found-item[data-msgid].editorial-highlighted {
    background-color: transparent !important;
    outline: none !important;
    padding: 0 !important;
    border: none !important;
}

.lost-and-found-item[data-msgid].editorial-highlighted .editorial-marker {
    opacity: 1 !important;
    pointer-events: auto !important;
    background-color: #ef5350 !important; /* Premium vibrant red */
    box-shadow: 0 0 10px rgba(239, 83, 80, 0.8) !important;
    color: white !important;
    transform: scale(1.15) !important;
}

/* --- Premium Highlighter & Dashboard System --- */

[data-msgid].editorial-highlighted {
    background-color: rgba(255, 75, 75, 0.1) !important;
    outline: 1px dashed rgba(255, 75, 75, 0.4);
    border-radius: 4px;
    padding: 2px 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-msgid].editorial-highlighted:hover {
    background-color: rgba(255, 75, 75, 0.18) !important;
    outline: 1px solid rgba(255, 75, 75, 0.7);
}

[data-msgid].editorial-highlighted .editorial-marker {
    opacity: 1 !important;
    pointer-events: auto;
    background-color: #ff4b4b !important;
    box-shadow: 0 0 8px rgba(255, 75, 75, 0.4);
}

.dashboard-wrapper {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
}

.dashboard-header-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text, #333333);
    border-bottom: 2px solid rgba(0, 74, 198, 0.08);
    padding-bottom: 0.8rem;
    margin-bottom: 0.5rem;
}

.dashboard-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text, #333333);
}

.card-description {
    font-size: 0.85rem;
    color: var(--text-muted, #777777);
    line-height: 1.45;
    margin: 0;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #e0e0e0;
    transition: .3s ease;
    border-radius: 24px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 3px; bottom: 3px;
    background-color: white;
    transition: .3s ease;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

input:checked + .switch-slider {
    background-color: var(--primary, #004ac6);
}

input:checked + .switch-slider:before {
    transform: translateX(20px);
}

/* Slider Controls */
.slider-control-group {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: opacity 0.3s ease;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.threshold-badge {
    background-color: rgba(0, 74, 198, 0.08);
    color: var(--primary, #004ac6);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
}

input[type=range]#highlighter-threshold {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    margin: 0.8rem 0 0.4rem 0;
}

input[type=range]#highlighter-threshold::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--primary, #004ac6);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s ease;
}

input[type=range]#highlighter-threshold::-webkit-slider-thumb:hover {
    transform: scale(1.25);
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    padding: 0 6px; /* Align with slider boundaries */
    margin-top: -12px; /* Pull them up to visually align with track */
    pointer-events: none;
}

.slider-ticks span {
    width: 2px;
    height: 6px;
    background-color: #d8dbdf;
    border-radius: 1px;
}

.slider-container-relative {
    position: relative;
    margin-top: 1.8rem;
    padding-bottom: 0.5rem;
    width: 100%;
}

.slider-bubble {
    position: absolute;
    top: -20px;
    color: var(--text, #333333);
    font-size: 0.85rem;
    font-weight: 700;
    transform: translateX(-50%);
    pointer-events: none;
    white-space: nowrap;
}

/* Chart Placeholder */
.chart-placeholder-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: rgba(0, 74, 198, 0.01) !important;
    border: 1px dashed rgba(0, 74, 198, 0.15) !important;
    padding: 2.5rem 1.5rem !important;
}

.chart-placeholder-icon {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
    animation: float-anim 3s ease-in-out infinite;
}

@keyframes float-anim {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* Premium AI Review Styling */
.review-comment-container {
    margin-top: 0.8rem;
    padding: 0.8rem;
    background-color: rgba(0, 74, 198, 0.03);
    border-left: 3px solid var(--primary, #004ac6);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.review-title-group {
    display: flex;
    align-items: center;
}

.review-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary, #004ac6);
}

.review-copy-btn {
    background: transparent;
    border: 1px solid rgba(0, 74, 198, 0.2);
    color: var(--primary, #004ac6);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.review-copy-btn:hover {
    background-color: var(--primary, #004ac6);
    color: white;
    border-color: var(--primary, #004ac6);
}

.review-text {
    margin: 0;
}

.review-text pre.code-block {
    background-color: rgba(255, 255, 255, 0.6) !important;
    border: 1px solid rgba(0, 0, 0, 0.04) !important;
}

/* Quality Report Chart Styles */
.quality-report-card {
    margin-bottom: 1.5rem;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
    font-size: 0.76rem;
    color: #555;
    background: rgba(0, 0, 0, 0.02);
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-color.red { background-color: #ef5350; }
.legend-color.yellow { background-color: #fec107; }
.legend-color.light-green { background-color: #9ccc65; }
.legend-color.dark-green { background-color: #2e7d32; }
.legend-color.gray { background-color: #b0bec5; }

.chart-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.4rem;
}

/* Scrollbar styling for chart container */
.chart-container::-webkit-scrollbar {
    width: 4px;
}
.chart-container::-webkit-scrollbar-track {
    background: transparent;
}
.chart-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

.chart-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    padding: 0.15rem 0.3rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.chart-row:hover {
    background-color: rgba(0, 74, 198, 0.03);
}

.chart-row-label {
    color: var(--primary, #004ac6);
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s ease;
    flex-grow: 1;
    min-width: 0;
    text-align: right;
}

.chart-row-label:hover {
    opacity: 0.85;
}

.chart-stacked-bar {
    display: flex;
    height: 10px;
    border-radius: 10px;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.05);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chart-stacked-bar:hover {
    transform: scaleY(1.2);
    box-shadow: 0 2px 5px rgba(0, 74, 198, 0.15);
}

.bar-segment {
    height: 100%;
    transition: width 0.3s ease;
}

.bar-segment.red { background-color: #ef5350; }
.bar-segment.yellow { background-color: #fec107; }
.bar-segment.light-green { background-color: #9ccc65; }
.bar-segment.dark-green { background-color: #2e7d32; }
.bar-segment.gray { background-color: #b0bec5; }
.bar-segment.fresh-1 { background-color: rgba(16, 172, 132, 0.85); }
.bar-segment.fresh-2 { background-color: rgba(16, 172, 132, 0.60); }
.bar-segment.fresh-3 { background-color: rgba(16, 172, 132, 0.35); }
.bar-segment.fresh-4 { background-color: rgba(16, 172, 132, 0.15); }


/* --- Premium Translation Freshness Highlighter --- */
[data-msgid].editorial-since-highlight {
    position: relative;
    border-left: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-msgid].editorial-since-highlight::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--since-left, -30px); /* JS가 동적으로 계산한 절대 가로 정렬 위치 적용 */
    width: 3px;
    background-color: rgba(16, 172, 132, var(--since-opacity, 0.85));
    border-radius: 1.5px;
    transition: opacity 0.3s ease;
}

[data-msgid].editorial-since-highlight:hover {
    background-color: rgba(16, 172, 132, 0.04) !important;
}

/* Responsive Design (Mobile / Tablet) */
@media (max-width: 992px) {
    #editorial-container {
        flex-direction: column;
    }

    #editorial-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 300px;
        max-width: 85%;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }

    #editorial-sidebar.open {
        transform: translateX(0);
    }

    /* Dimmed overlay when sidebar is open in mobile */
    #editorial-sidebar-backdrop {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    #editorial-sidebar-backdrop.visible {
        display: block;
    }

    .sidebar-mobile-close-container {
        display: flex;
        justify-content: flex-end;
        margin-bottom: 1rem;
    }

    #editorial-sidebar-close {
        background: none;
        border: none;
        color: var(--text-muted);
        font-size: 1.1rem;
        cursor: pointer;
        font-weight: 600;
        padding: 0.5rem;
    }

    #editorial-main {
        padding: 1.5rem 1rem;
    }

    .editorial-mobile-header {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 0.75rem 0;
        margin-bottom: 1.5rem;
        border-bottom: 1px solid var(--border);
    }

    #editorial-sidebar-toggle {
        background: var(--primary-light);
        border: 1px solid var(--primary);
        color: var(--primary);
        padding: 0.4rem 0.8rem;
        border-radius: 4px;
        cursor: pointer;
        font-weight: 500;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
    }

    #editorial-sidebar-toggle:hover {
        background: var(--primary);
        color: white;
    }

    .mobile-project-title {
        font-family: var(--font-heading);
        font-weight: 600;
        font-size: 1.1rem;
        color: var(--text);
    }
}

#editorial-sidebar-expand-btn {
    display: none;
}

@media (min-width: 993px) {
    .editorial-mobile-header {
        display: none;
    }
    .sidebar-mobile-close-container {
        display: none;
    }

    /* Desktop Sidebar Collapse / Expand Styles */
    #editorial-sidebar {
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                    padding 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                    border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    #editorial-sidebar.collapsed {
        width: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        border-right-color: transparent !important;
        overflow: hidden !important;
    }

    #editorial-sidebar > * {
        transition: opacity 0.2s ease;
    }

    #editorial-sidebar.collapsed > * {
        opacity: 0;
        pointer-events: none;
    }

    .sidebar-desktop-toggle-container {
        display: flex;
        justify-content: flex-end;
        margin-bottom: 1rem;
    }

    #editorial-sidebar-collapse-btn {
        background: transparent;
        border: none;
        color: var(--text-muted);
        font-size: 1.1rem;
        cursor: pointer;
        padding: 4px 8px;
        border-radius: 4px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: background 0.2s, color 0.2s;
    }

    #editorial-sidebar-collapse-btn:hover {
        background: var(--border);
        color: var(--text);
    }

    #editorial-sidebar-expand-btn {
        display: none; /* Hidden by default */
        background: var(--primary-light);
        border: 1px solid var(--primary);
        color: var(--primary);
        padding: 0.4rem 0.8rem;
        border-radius: 4px;
        cursor: pointer;
        font-weight: 500;
        align-items: center;
        gap: 0.5rem;
        margin-bottom: 1.5rem;
        width: max-content;
    }

    #editorial-sidebar-expand-btn:hover {
        background: var(--primary);
        color: white;
    }

    /* Show expand button only when sidebar is collapsed in desktop */
    .editorial-sidebar-collapsed-state #editorial-sidebar-expand-btn {
        display: inline-flex;
    }
}





