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

body {
	font-family:    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size:      14px;
	color:          #1e1b4b;
	background:     #F1F3F5;
	min-block-size: 100vh;
	padding-block:  24px;
	padding-inline: 24px;
	overflow-x:     clip;
}

.page {
	max-inline-size: 760px;
	margin-inline:   auto;
}

/* ─── Login view ────────────────────────────────────────────────────────── */
/* Exactly one of #login-view, .page is visible at a time — this site has no
   reduced/non-admin view at all, unlike the extension's #user-minimal-view. */
#login-view { display: none; }
body.login-mode #login-view { display: flex; }
body.login-mode .page       { display: none; }

#login-view {
	align-items:     center;
	justify-content: center;
	min-block-size:  calc(100vh - 48px);
}

.login-card {
	background:       #fff;
	border-radius:    12px;
	padding:          28px;
	box-shadow:       0 1px 4px rgba(109, 40, 217, 0.08);
	inline-size:      100%;
	max-inline-size:  320px;
}

.login-card h2 {
	font-size:          17px;
	font-weight:        700;
	color:              #1E2871;
	margin-block-end:   6px;
}

.login-card .description {
	font-size:          12px;
	color:              #1E2871;
	margin-block-end:   18px;
}

.login-card input { margin-block-end: 2px; }
.login-card .actions { justify-content: flex-start; }
.login-card .status { display: block; margin-block-start: 10px; }

#admin-session-bar {
	display:          flex;
	align-items:      center;
	justify-content:  flex-end;
	gap:              10px;
	margin-block-end: 10px;
	font-size:        12px;
	color:            #6b7280;
}

header {
	display:          flex;
	align-items:      center;
	gap:              12px;
	margin-block-end: 16px;
}

header .logo { font-size: 28px; }
header h1 { font-size: 20px; font-weight: 700; color: #1E2871; }
header p { font-size: 13px; color: #1E2871; margin-block-start: 2px; }

.card {
	background:       #fff;
	border-radius:    12px;
	padding:          18px;
	margin-block-end: 12px;
	box-shadow:       0 1px 4px rgba(109, 40, 217, 0.08);
}

.card h2 { font-size: 15px; font-weight: 600; color: #1E2871; margin-block-end: 4px; }
.card .description { font-size: 12px; color: #1E2871; margin-block-end: 16px; }

label {
	display:          block;
	font-size:        13px;
	font-weight:      500;
	color:            #374151;
	margin-block-end: 6px;
}

.input-row { display: flex; gap: 8px; flex-wrap: wrap; }

input[type="password"],
input[type="email"],
input[type="text"] {
	flex:          1;
	padding:       8px 12px;
	border:        1px solid #E0E6EB;
	border-radius: 6px;
	font-size:     13px;
	font-family:   monospace;
	color:         #1e1b4b;
	outline:       none;
	transition:    border-color 0.15s;
}

input:focus { border-color: #1E2871; }

textarea {
	inline-size:    100%;
	min-block-size: 260px;
	padding:        10px 12px;
	border:         1px solid #E0E6EB;
	border-radius:  6px;
	font-size:      13px;
	font-family:    monospace;
	color:          #1e1b4b;
	line-height:    1.6;
	resize:         vertical;
	outline:        none;
	transition:     border-color 0.15s;
}

textarea:focus { border-color: #1E2871; }

select {
	width:            100%;
	padding:          8px 12px;
	border:           1px solid #E0E6EB;
	border-radius:    6px;
	font-size:        13px;
	color:            #1e1b4b;
	background-color: #fff;
	outline:          none;
	transition:       border-color 0.15s;
	cursor:           pointer;
}

select:focus { border-color: #1E2871; }

.btn {
	display:       inline-flex;
	align-items:   center;
	padding:       8px 16px;
	border:        none;
	border-radius: 6px;
	font-size:     13px;
	font-weight:   600;
	cursor:        pointer;
	transition:    background 0.15s;
	white-space:   nowrap;
}

.btn-primary { background: #1E2871; color: #fff; }
.btn-primary:hover { background: #1E2871; }
.btn-secondary { background: #F1F3F5; color: #1E2871; }
.btn-secondary:hover { background: #ddd6fe; }
.btn-danger { background: #fee2e2; color: #991b1b; }
.btn-danger:hover:not(:disabled) { background: #fecaca; }
.btn-danger:disabled { opacity: 0.4; cursor: default; }
.btn:disabled { opacity: 0.6; cursor: default; }

.actions {
	display:            flex;
	align-items:        center;
	gap:                10px;
	margin-block-start: 12px;
	flex-wrap:          wrap;
}

.status {
	font-size:     13px;
	padding:       4px 10px;
	border-radius: 20px;
	font-weight:   500;
}

.status.success { background: #dcfce7; color: #166534; }
.status.error   { background: #fee2e2; color: #991b1b; }
.status.info    { background: #F1F3F5; color: #1E2871; }

.hint { font-size: 11px; color: #9ca3af; margin-block-start: 6px; }

.key-row { display: flex; align-items: center; gap: 8px; margin-block-end: 6px; }

.toggle-btn {
	background:    #F1F3F5;
	color:         #1E2871;
	border:        none;
	border-radius: 6px;
	padding:       8px 10px;
	font-size:     12px;
	cursor:        pointer;
	white-space:   nowrap;
}
.toggle-btn:hover { background: #ddd6fe; }

/* Profile/template card header row (title + import/export buttons) */
.profiles-card-header {
	display:          flex;
	align-items:      center;
	justify-content:  space-between;
	margin-block-end: 4px;
}
.profiles-card-header h2 { margin-block-end: 0; }
.profiles-actions { display: flex; gap: 6px; }

.btn-icon-action {
	display:       flex;
	align-items:   center;
	gap:           5px;
	font-size:     12px;
	font-weight:   500;
	color:         #6b7280;
	background:    transparent;
	border:        1px solid #e5e7eb;
	border-radius: 6px;
	padding:       4px 8px;
	cursor:        pointer;
	transition:    background .15s, color .15s, border-color .15s;
}
.btn-icon-action:hover { background: #f3f4f6; color: #374151; border-color: #d1d5db; }

/* Accordion (profiles / templates / zendesk) */
.profile-item {
	border-radius:             8px;
	border:                    1.5px solid #e9e3ff;
	border-inline-start-width: 4px;
	overflow:                  hidden;
	background:                #faf5ff;
	margin-block-end:          6px;
}

.profile-header { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; user-select: none; }
.profile-header:hover { background: rgba(0, 0, 0, .03); }

.profile-item-locked { opacity: 0.65; }
.profile-item-locked .profile-header { cursor: default; }
.profile-item-locked .profile-header:hover { background: none; }

.profile-item.open .profile-header { border-block-end: 1px solid #e9e3ff; }

.profile-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.profile-header-name { flex: 1; font-size: 14px; font-weight: 500; color: #374151; }

.btn-trash, .btn-export {
	display:         flex;
	align-items:     center;
	justify-content: center;
	width:           28px;
	height:          28px;
	border-radius:   6px;
	border:          none;
	background:      transparent;
	color:           #9ca3af;
	cursor:          pointer;
	flex-shrink:     0;
	transition:      background .15s, color .15s;
}
.btn-trash:hover { background: #fee2e2; color: #dc2626; }
.btn-export:hover { background: #dbeafe; color: #1d4ed8; }

.profile-chevron { width: 16px; height: 16px; color: #9ca3af; transition: transform 0.2s ease; flex-shrink: 0; }
.profile-item.open .profile-chevron { transform: rotate(180deg); }

.profile-body { display: none; flex-direction: column; gap: 12px; padding: 14px 12px; }
.profile-item.open .profile-body { display: flex; }

/* Usage history */
.usage-totals { display: flex; gap: 20px; flex-wrap: wrap; padding: 12px 16px; background: #faf5ff; border-radius: 8px; margin-block-end: 16px; }
.usage-stat { display: flex; flex-direction: column; gap: 2px; }
.usage-stat-value { font-size: 18px; font-weight: 700; color: #1E2871; }
.usage-stat-label { font-size: 11px; color: #1E2871; }

.usage-table { inline-size: 100%; border-collapse: collapse; font-size: 12px; }
.usage-table th { text-align: start; padding: 6px 8px; color: #1E2871; font-weight: 600; border-bottom: 1px solid #e9e3ff; }
.usage-table td { padding: 6px 8px; color: #374151; border-bottom: 1px solid #f3f0ff; }
.usage-table tbody tr:last-child td { border-bottom: none; }

.usage-type { display: inline-block; padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 600; }
.usage-type-generate  { background: #1E2871; color: #fff; }
.usage-type-revise    { background: #fce7f3; color: #831843; }
.usage-type-refine    { background: #d1fae5; color: #065f46; }
.usage-type-describe  { background: #f3f4f6; color: #374151; }
.usage-type-questions { background: #fef9c3; color: #713f12; }
.usage-type-profile   { background: #ede9fe; color: #4c1d95; }

.usage-provider-claude { background: #1E2871; color: #fff; }
.usage-provider-openai { background: #dbeafe; color: #1e40af; }
.usage-provider-litellm { background: #e0e7ff; color: #3730a3; }
.usage-provider-anthropic { background: #ede9fe; color: #5b21b6; }
.usage-provider-openai-compatible { background: #dbeafe; color: #1e40af; }

/* Toggle switch — iOS-style pill */
.toggle-row { display: flex; align-items: center; gap: 12px; }
.toggle-switch { position: relative; display: inline-block; inline-size: 44px; block-size: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; inline-size: 0; block-size: 0; position: absolute; }
.toggle-slider { position: absolute; inset: 0; background: #E0E6EB; border-radius: 24px; cursor: pointer; transition: background 0.2s; }
.toggle-slider::before { content: ""; position: absolute; block-size: 18px; inline-size: 18px; inset-block-start: 3px; inset-inline-start: 3px; background: #fff; border-radius: 50%; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.toggle-switch input:checked + .toggle-slider { background: #1E2871; }
.toggle-switch input:disabled + .toggle-slider { opacity: 0.45; cursor: default; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-label { font-size: 14px; font-weight: 500; color: #374151; }

/* Tab bar */
.tab-bar { display: flex; border-bottom: 2px solid #e9e3ff; margin-block-end: 24px; flex-wrap: wrap; }
.tab-btn {
	background:    none;
	border:        none;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	padding:       10px 18px;
	font-size:     14px;
	font-weight:   500;
	color:         #1E2871;
	cursor:        pointer;
	transition:    color 0.15s, border-color 0.15s;
	white-space:   nowrap;
}
.tab-btn:hover { color: #1E2871; }
.tab-btn.active { color: #1E2871; font-weight: 700; border-bottom-color: #1E2871; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.input-row + .status:not([hidden]) { display: block; margin-block-start: 6px; }

/* ─── Fallback key list ────────────────────────────────────────────────── */
.fallback-entry { margin-block-end: 6px; }
.fallback-label { inline-size: 130px; flex-shrink: 0; }
.fallback-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fallback-controls { display: flex; gap: 4px; flex-shrink: 0; }
.fallback-entry .status:not([hidden]) { display: block; margin-block-start: 4px; }

.drag-grip { color: #9ca3af; cursor: grab; flex-shrink: 0; display: flex; align-items: center; padding-inline: 2px; user-select: none; }
.drag-grip:active { cursor: grabbing; }
.fallback-entry.is-dragging { opacity: 0.4; }
.fallback-entry.drag-over { box-shadow: 0 0 0 2px #1E2871; border-radius: 6px; }

.fallback-row-2 { display: flex; align-items: center; gap: 6px; margin-block-start: 6px; flex-wrap: wrap; }
.fallback-provider { inline-size: 180px; flex-shrink: 0; }
.fallback-endpoint { flex: 3; min-inline-size: 0; }
.fallback-model    { inline-size: 150px; flex-shrink: 0; }
.test-btn { margin-inline-start: 2px; }

/* ─── Team list ────────────────────────────────────────────────────────── */
.team-row { padding: 10px 0; border-block-end: 1px solid #f3f0ff; }
.team-row:last-child { border-block-end: none; }
.team-row-1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.team-email        { font-size: 13px; font-weight: 600; color: #1e1b4b; inline-size: 200px; flex-shrink: 0; overflow-wrap: anywhere; }
.team-display-name { inline-size: 160px; flex-shrink: 0; }
.team-role-select   { inline-size: 100px; flex-shrink: 0; }
.team-row-2 { display: flex; align-items: center; gap: 6px; margin-block-start: 8px; flex-wrap: wrap; }
.team-last-seen { font-size: 12px; color: #9ca3af; }
.team-reset-row { display: flex; gap: 6px; margin-block-start: 8px; flex-wrap: wrap; }
.team-llm-row { display: flex; align-items: center; gap: 6px; margin-block-start: 8px; flex-wrap: wrap; }

/* ─── Reply History tab ────────────────────────────────────────────────── */
.rh-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-block-end: 14px; }
.rh-filters input, .rh-filters select { inline-size: auto; min-inline-size: 140px; flex: 1; }
.rh-table { inline-size: 100%; border-collapse: collapse; font-size: 12px; }
.rh-table th { text-align: start; padding: 6px 8px; color: #1E2871; font-weight: 600; border-bottom: 1px solid #e9e3ff; }
.rh-table td { padding: 6px 8px; color: #374151; border-bottom: 1px solid #f3f0ff; vertical-align: top; }
.rh-reply-preview { max-inline-size: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.rh-row-actions { display: flex; gap: 4px; white-space: nowrap; }

@media (max-width: 767px) {
	body { padding-inline: 12px; padding-block: 24px; }
	.card { padding: 14px; border-radius: 8px; }
	.tab-btn { padding: 8px 14px; font-size: 13px; }
}

/* ─── Generate-with-AI modal ──────────────────────────────────────────── */
#generate-prompt-modal {
	border: none; border-radius: 12px; padding: 0;
	max-inline-size: 640px; inline-size: calc(100vw - 48px);
	max-block-size: 90vh; overflow: hidden;
	box-shadow: 0 8px 32px rgba(30, 40, 113, 0.2);
}
#generate-prompt-modal::backdrop { background: rgba(0, 0, 0, 0.45); }

#import-visibility-modal {
	border: none; border-radius: 12px; padding: 20px;
	max-inline-size: 360px; box-shadow: 0 8px 32px rgba(30, 40, 113, 0.2);
}
#import-visibility-modal::backdrop { background: rgba(0, 0, 0, 0.45); }
#import-visibility-modal .actions { display: flex; gap: 8px; margin-block-start: 14px; }

.modal-inner { display: flex; flex-direction: column; max-block-size: 90vh; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 12px; border-block-end: 1px solid #e9e3ff; flex-shrink: 0; }
.modal-header h3 { font-size: 16px; font-weight: 700; color: #1E2871; }
.modal-close { background: none; border: none; font-size: 18px; line-height: 1; color: #9ca3af; cursor: pointer; padding: 4px 6px; border-radius: 4px; }
.modal-close:hover { color: #374151; background: #f3f4f6; }
.modal-body { overflow-y: auto; padding: 20px; flex: 1; }
.modal-step { display: none; }
.modal-step.active { display: block; }
.modal-step-label { font-size: 11px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.04em; margin-block-end: 14px; }
.modal-field { margin-block-end: 14px; }
#generate-prompt-modal textarea { min-block-size: 80px; font-family: inherit; }
#step3-textarea { min-block-size: 300px; font-family: monospace; }
#generate-prompt-modal input[type="text"] { font-family: inherit; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-block-start: 1px solid #e9e3ff; background: #faf9ff; flex-shrink: 0; }
.modal-error { font-size: 12px; color: #991b1b; background: #fee2e2; padding: 8px 12px; border-radius: 6px; margin-block-start: 10px; display: none; }
.modal-error.visible { display: block; }
.modal-spinner { display: inline-block; inline-size: 13px; block-size: 13px; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; border-radius: 50%; animation: modal-spin 0.65s linear infinite; margin-inline-end: 6px; vertical-align: middle; }
@keyframes modal-spin { to { transform: rotate(360deg); } }
.modal-section-header { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #1E2871; padding-block-end: 6px; border-block-end: 1px solid #e9e3ff; margin-block: 16px 10px; }
.modal-section-header:first-child { margin-block-start: 0; }
.modal-scroll-hint { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 16px; font-size: 12px; font-weight: 500; color: #6b7280; background: #faf9ff; border-block: 1px solid #e9e3ff; user-select: none; pointer-events: none; flex-shrink: 0; }
.modal-hint { font-size: 12px; color: #6b7280; margin-block-end: 14px; }

/* ─── Rich text editor ───────────────────────────────────────────────── */
.rich-editor { border: 1px solid #E0E6EB; border-radius: 6px; overflow: hidden; transition: border-color 0.15s; }
.rich-editor:focus-within { border-color: #1E2871; }
.rich-editor-toolbar { display: flex; align-items: center; gap: 2px; padding: 6px 8px; background: #f8f9fa; border-block-end: 1px solid #E0E6EB; flex-wrap: wrap; }
.rich-toolbar-btn { display: inline-flex; align-items: center; justify-content: center; min-inline-size: 28px; block-size: 26px; padding-inline: 6px; border: 1px solid transparent; border-radius: 4px; background: transparent; font-size: 12px; font-weight: 600; color: #374151; cursor: pointer; transition: background 0.1s, border-color 0.1s; white-space: nowrap; flex-shrink: 0; }
.rich-toolbar-btn:hover { background: #e9ecef; border-color: #dee2e6; }
.rich-toolbar-sep { inline-size: 1px; block-size: 18px; background: #dee2e6; margin-inline: 2px; flex-shrink: 0; }
.rich-editor-content { min-block-size: 120px; padding: 10px 12px; font-size: 13px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.6; color: #1e1b4b; outline: none; overflow-y: auto; }
.rich-editor-content:empty::before { content: attr(data-placeholder); color: #9ca3af; pointer-events: none; }

/* ─── Template profile chips ──────────────────────────────────────────── */
.template-profile-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-block-start: 4px; }
.template-profile-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border: 1px solid #e5e7eb; border-radius: 99px; font-size: 12px; font-weight: 400; color: #374151; cursor: pointer; background: transparent; transition: background 0.1s, border-color 0.1s; user-select: none; }
.template-profile-chip:hover { background: #f9fafb; }
.template-profile-chip input[type="checkbox"] { width: 13px; height: 13px; margin: 0; cursor: pointer; accent-color: #1E2871; flex-shrink: 0; }
.template-profile-chip:has(input:checked) { background: #ede9fe; border-color: #c4b5fd; color: #1E2871; }

/* ─── Expand-to-full-page prompt button ─────────────────────────────── */
.prompt-label-row { display: flex; align-items: center; gap: 8px; margin-block-end: 6px; }
.prompt-label-row label { margin-block-end: 0; }
.btn-expand-prompt { font-size: 11px; color: #9ca3af; background: transparent; border: 1px solid #e5e7eb; border-radius: 5px; padding: 2px 8px; cursor: pointer; transition: background .15s, color .15s; flex-shrink: 0; }
.btn-expand-prompt:hover { background: #f3f4f6; color: #374151; }

/* ─── Full-screen editor overlay ──────────────────────────────────────── */
#prompt-editor-overlay { display: none; position: fixed; inset: 0; flex-direction: column; background: #F1F3F5; z-index: 9999; }
body.editor-mode #prompt-editor-overlay { display: flex; }
body.editor-mode .page { display: none; }
.editor-header { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: #fff; border-block-end: 1px solid #e9e3ff; flex-shrink: 0; flex-wrap: wrap; }
.editor-profile-name { flex: 1; font-size: 15px; font-weight: 600; color: #1E2871; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#editor-textarea { flex: 1; resize: none; border: none; border-radius: 0; min-block-size: unset; inline-size: 100%; padding: 20px 24px; font-size: 14px; font-family: monospace; line-height: 1.6; color: #1e1b4b; outline: none; background: #fff; }
#editor-textarea:focus { border-color: transparent; }

/* ─── Refine-with-AI bar ──────────────────────────────────────────────── */
#editor-refine-bar { display: none; align-items: flex-start; gap: 10px; padding: 12px 20px; background: #f8f7ff; border-block-end: 1px solid #e9e3ff; flex-shrink: 0; }
body.editor-mode.refine-open #editor-refine-bar { display: flex; }
#editor-refine-input { flex: 1; resize: vertical; block-size: 60px; min-block-size: 44px; font-size: 13px; font-family: inherit; line-height: 1.5; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; color: #1e1b4b; background: #fff; outline: none; }
#editor-refine-input:focus { border-color: #6366f1; box-shadow: 0 0 0 2px #e0e7ff; }

/* ─── Diff view ─────────────────────────────────────────────────────────── */
body.editor-mode.diff-mode #editor-textarea  { display: none; }
body.editor-mode.diff-mode #editor-diff-view { display: grid; }
body.editor-mode.diff-mode #editor-refine-btn,
body.editor-mode.diff-mode #editor-compress-btn,
body.editor-mode.diff-mode #editor-close-btn,
body.editor-mode.diff-mode #editor-save-btn  { display: none; }
#editor-save-btn[hidden] { display: none; }
body.editor-mode:not(.diff-mode) #editor-diff-accept-btn,
body.editor-mode:not(.diff-mode) #editor-diff-reject-btn,
body.editor-mode:not(.diff-mode) #editor-diff-summary,
body.editor-mode:not(.diff-mode) #editor-diff-truncated-warning,
body.editor-mode:not(.diff-mode) #diff-prev-btn,
body.editor-mode:not(.diff-mode) #diff-nav-label,
body.editor-mode:not(.diff-mode) #diff-next-btn           { display: none; }
#editor-diff-view { display: none; grid-template-columns: 1fr 1fr; align-content: start; flex: 1; overflow-y: auto; background: #fff; }
#editor-diff-summary { flex: 1; font-size: 12px; color: #6b7280; }
#diff-nav-label { font-size: 12px; color: #6b7280; min-width: 4em; text-align: center; white-space: nowrap; }
.diff-col-header { position: sticky; top: 0; z-index: 1; background: #f6f8fa; border-block-end: 1px solid #e1e4e8; padding: 5px 12px; font-size: 11px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; user-select: none; }
.diff-col-header:first-child { border-inline-end: 1px solid #e1e4e8; }
.diff-cell { padding: 2px 10px; font-family: monospace; font-size: 13px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.diff-cell-before { border-inline-end: 1px solid #e1e4e8; }
.diff-cell.diff-add    { background: #e6ffed; }
.diff-cell.diff-remove { background: #ffeef0; }
.diff-cell.diff-empty  { background: #f6f8fa; }
.diff-cell.diff-add ins    { background: #acf2bd; text-decoration: none; border-radius: 2px; padding-inline: 1px; }
.diff-cell.diff-remove del { background: #fdb8c0; text-decoration: none; border-radius: 2px; padding-inline: 1px; }

/* ─── Version history panel ─────────────────────────────────────────────── */
body.editor-mode.diff-mode #editor-history-btn { display: none; }
body.editor-mode.history-mode #editor-history-view { display: flex; }
body.editor-mode.history-mode #editor-textarea     { display: none; }
body.editor-mode.history-compare-mode #editor-diff-view   { display: grid; }
body.editor-mode.history-compare-mode #editor-textarea,
body.editor-mode.history-compare-mode #editor-history-view { display: none; }
body.editor-mode.history-compare-mode #editor-history-btn,
body.editor-mode.history-compare-mode #editor-refine-btn,
body.editor-mode.history-compare-mode #editor-compress-btn,
body.editor-mode.history-compare-mode #editor-close-btn,
body.editor-mode.history-compare-mode #editor-save-btn    { display: none; }
body.editor-mode:not(.history-compare-mode) #history-compare-back-btn,
body.editor-mode:not(.history-compare-mode) #history-compare-restore-btn { display: none; }
#editor-history-view { display: none; flex: 1; flex-direction: column; overflow-y: auto; background: #fff; }
.history-empty { padding: 40px 20px; text-align: center; color: #9ca3af; font-size: 14px; }
.history-entry { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-block-end: 1px solid #f0f0f0; }
.history-entry:hover { background: #f8f7ff; }
.history-time { font-size: 12px; color: #6b7280; white-space: nowrap; flex-shrink: 0; }
.history-badge { font-size: 11px; color: #6366f1; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.history-preview { flex: 1; font-family: monospace; font-size: 12px; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-preview.history-preview-loading { font-family: inherit; font-style: italic; color: #9ca3af; }
