/* Theme: dark-moon (default). Lives in :root directly so it's the fallback
   even if the theme class/attribute isn't set for any reason. */
:root {
	--white: #ffffff;
	--black: #000000;
    --bg: #10121a;
    --surface: #1c1f2b;
    --surface-hover: #242837;
    --border: #2e3244;
    --text: #dcdae4;
    --text-muted: #9490a8;
	--text-tag: #fde68a;
	--text-tag-bg: #f5e6a8;
    --accent: #a5b4fc;
	--accent-hover: #c7d2fe;
	--text-btn: #191527;
	--success: #16a34a;
	--success-hover: #15803d;
	--warning: #fcd34d;
	--warning-hover: #f5c542;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --transition-fast: 0.15s ease;

    --status-untranslated: var(--text-muted);
    --status-translated: #93c5fd;
    --status-approved: #86efac;
}

/* Theme: light-moon (opt-in). Toggle later by setting class="light-moon"
   on <html> — no JS/CSS wiring needed beyond that for the switch itself. */
:root.light-moon {
    --bg: #f4f3f9;
    --surface: #faf9fd;
    --surface-hover: #ececf5;
    --border: #ddd9ec;
    --text: #2b2a35;
    --text-muted: #6b6878;
	--text-tag: #4a2c05;
	--text-tag-bg: #bc8b32;
    --accent: #6d63c9;
	--accent-hover: #5a51b3;
	--text-btn: #ffffff;
	--warning: #d97706;
	--warning-hover: #b45309;

    --status-untranslated: var(--text-muted);
    --status-translated: #2563eb;
    --status-approved: #16a34a;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; max-width: 100vw; }
body {
    font-family: -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}
h1 { font-size: 1.75rem; font-weight: bold; }
a { text-decoration: none; color: var(--accent); }
a:hover { color: var(--accent-hover); }
svg { width: 100%; height: 100%; display: block; }
label { display: flex; align-items: center;  gap: 0.4rem; font-size: 0.85rem;  color: var(--text-muted); }
select {
    background: var(--bg); border: 1px solid var(--border); color: var(--text);
    border-radius: 6px; padding: 0.5rem 0.7rem; font-size: 0.85rem;
}
input, textarea {
    background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
    color: var(--text); padding: 0.5rem 0.7rem; font-size: 0.85rem;
}
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
}
input[type="checkbox"] {
  position: relative;
  width: 1em;
  height: 1em;
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 0;
  border-radius: 4px;
}

input[type="checkbox"]::before {
  content: "✔";
  position: absolute;
  font-size: 1.2em;
  right: 0px;
  top: -0.3em;
  visibility: hidden;
}

input[type="checkbox"]:checked::before {
  visibility: visible;
}

input[type="checkbox"]:disabled {
  opacity: 0.5;
}
button {
	display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.7rem; border-radius: 6px; font-weight: bold;
	background: var(--border); color: var(--text); text-decoration: none; font-size: 0.85rem; border: none; cursor: pointer;
}
button:hover { background: var(--accent); color: var(--text-btn); }


a, button, .project-card, .language-row, input, select, .sidebar-link, .sidebar-sublink {
    transition: all var(--transition-fast);
}
input:focus, select:focus, textarea:focus, #search-input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.icon-wrapper { width: 16px; height: 16px; display: block; }
.label-title {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

/* ===== Start Website ====== */
.title-box { margin-bottom: 1rem; }
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.project-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.25rem;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s ease;
}
.project-card:hover {
    border-color: var(--accent);
    background: var(--surface-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.project-card h2 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}
.project-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}
.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.back-link {
    display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.7rem; border-radius: 6px;
    background: var(--border); color: var(--text); text-decoration: none; font-size: 0.85rem; font-weight: 600;
    transition: background 0.15s ease;
}
.back-link:hover { background: var(--accent); color: var(--text-btn); }
.language-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    text-decoration: none;
    color: var(--text);
}
.language-row:hover { border-color: var(--accent); background: var(--surface-hover); color: inherit; }
.language-info { display: flex; flex-direction: column; gap: 0.3rem; }
.language-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s ease;
}
.language-meta {
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.btn {
    display: inline-block; background: var(--accent); color: var(--text-btn);
	font-weight: bold; padding: 0.6rem 1.2rem; border-radius: 6px;
    text-decoration: none; font-size: 0.9rem; border: none;
}
.btn:hover { background: var(--accent-hover); transform: translateY(-1px); color: var(--text-btn) }
.btn:active { transform: translateY(0); }
.btn-icon { width: 16px; height: 16px; display: block; }
.with-icon { display: flex; align-items: center; gap: 0.5rem; }
.with-inline-icon { display: inline-flex; align-items: center; gap: 0.5rem; }
.btn-secondary {
    background: color-mix(in srgb, var(--bg) 75%, transparent); color: var(--text); text-decoration: none;
    border-radius: 6px; padding: 0.5rem 1rem; cursor: pointer; border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg); color: var(--accent); border-color: var(--accent); }
.copy-remove-btns { display: flex; align-items: center; gap: 0.25rem; }
td .copy-remove-btns { justify-content: flex-end; }
.icon-btn {
    background: none; border: none; color: var(--text-muted); cursor: pointer;
    padding: 0.3rem; vertical-align: middle; margin-left: 0.4rem; border-radius: 4px;
}
.icon-btn:hover { color: var(--text); background: var(--border); }
.app-shell {
    display: flex;
    min-height: 100vh;
}
.base-box {
	padding: 1.25rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 10px;
}
.edit-project-description { min-width: 300px; }
h2.section-title {
	margin: 1.5rem 0 1rem; font-size: 1rem; text-transform: uppercase;
	color: var(--text-muted); letter-spacing: 0.03em;
}
.danger-zone h2.section-title { color: var(--danger); }
h3.section-subtitle {
	margin: 0 0 0.75rem; font-size: 0.9rem; text-transform: uppercase;
	color: var(--text-muted); letter-spacing: 0.03em;
}
.tag-input-wrapper { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.5rem; }
.tag-chips { display: inline-flex; gap: 0.5rem; align-items: center; }
.project-card .tag-chips { margin-top: 0.75rem; }
.tag-chip button { font-size: 1rem; padding: 0.1rem 0.4rem; }
.tag-chip { display: flex; align-items: center; gap: 0.25rem; color: var(--text-tag); font-size: 0.75rem; }

/* ===== Sidebar ===== */
.sidebar {
	display: flex;
    flex-direction: column;
    width: 240px;
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    padding: 1.5rem 1rem;
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
}
.sidebar-logo-icon { width: 30px; height: 30px; }
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
	flex: 1;
}
.nav-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.25rem; height: 1.25rem; padding: 0 0.35rem; margin-left: auto;
    border-radius: 100px; background: var(--accent); color: var(--text-btn);
    font-size: 0.7rem; font-weight: 700;
}
.error-actions { display: flex; justify-content: center; gap: 0.5rem; margin-top: 0.75rem; }
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}
.sidebar-link:hover { background: var(--border); color: var(--text); }
.sidebar-link.active { background: var(--accent); color: var(--text-btn); }
.sidebar-icon { width: 18px; height: 18px; }
.sidebar-sublist {
    display: flex;
    flex-direction: column;
    margin: 0.25rem 0 0.5rem 0;
    padding-left: 1.7rem;
    gap: 0.15rem;
}
.sidebar-sublink {
    display: block;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
}
.sidebar-sublink:hover { background: var(--border); color: var(--text); }
.sidebar-sublink.active { background: var(--border); color: var(--text); font-weight: 500; }
.sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.6rem 0.25rem;
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
}
.sidebar-user {
    font-size: 0.78rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-logout {
    color: var(--text-muted);
    display: flex;
    padding: 0.3rem;
    border-radius: 6px;
}
.sidebar-logout:hover { color: var(--danger-hover); background: var(--border); }
.sidebar-logout .sidebar-icon { width: 16px; height: 16px; }

/* ===== General ===== */
.warning-banner {
	display: flex;
	align-items: center;
	gap: 0.25rem;
    background: color-mix(in srgb, var(--warning) 15%, transparent);
    color: var(--warning);
    border-bottom: 1px solid var(--warning);
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
}
.single-view-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: color-mix(in srgb, var(--accent) 15%, transparent);
	color: var(--accent);
    border-bottom: 1px solid var(--accent);
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}
.app-main {
    flex: 1;
	min-width: 0;
    padding: 2rem;
}
.overview-stats {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
}
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem 1.75rem; }
.stat-value { display: block; font-size: 1.75rem; font-weight: 700; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); }
.discord-link {
	width: 2.5rem; height: 2.5rem; background: var(--bg); border: 1px solid var(--border);
	border-radius: 100px; margin: 0.5rem auto; display: flex;
}
.home-help .discord-link {
	display: flex; align-items: center; gap: 0.5rem; margin: 0;
	width: fit-content; padding: 0 1rem; font-weight: 700;
}
.discord-link.discord-login { background: var(--surface); }
.discord-link.discord-login:hover { background: var(--surface-hover); }
.discord-icon { width: 1.5rem; height: auto; margin: auto; }
.landing-hero .discord-icon { margin: 0; }

/* ===== Progress Ring ===== */
.ring-group { display: flex; gap: 0.75rem; }
.ring-item { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.ring-caption { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.progress-ring {
    --size: 56px;
    --thickness: 5px;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: conic-gradient(var(--ring-color) calc(var(--percent) * 3.6deg), var(--border) 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}
.progress-ring::before {
    content: '';
    position: absolute;
    inset: var(--thickness);
    background: var(--surface);
    border-radius: 50%;
}
.progress-ring-label {
    position: relative;
    font-size: 0.8rem;
    font-weight: 700;
}
.has-tooltip { position: relative; }
.has-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% - 5px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    font-size: 0.72rem;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 20;
    pointer-events: none;
}
.has-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(8px);
}
.has-tooltip-multiline::after { white-space: pre-line; max-width: 280px; text-align: left; }
.tooltip-align-left::after { left: 0; transform: translateX(0) translateY(4px); }
.tooltip-align-left:hover::after, .tooltip-align-left:focus-within::after { transform: translateX(0) translateY(8px); }
.tooltip-align-right::after { left: auto; right: 0; transform: translateX(0) translateY(4px); }
.tooltip-align-right:hover::after, .tooltip-align-right:focus-within::after { transform: translateX(0) translateY(8px); }
.term-input-with-suggestions.has-suggestions { border-color: var(--warning); }

/* ===== Login ===== */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; flex-direction: column; }
.auth-logo { width: 200px; height: auto; margin: 2rem auto; }
.auth-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
    padding: 2rem; width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 0.9rem;
}
.auth-card h1 { font-size: 1.3rem; margin-bottom: 0.25rem; }
.auth-sub { color: var(--text-muted); font-size: 0.85rem; margin-top: -0.5rem; }
.auth-card label { flex-direction: column; gap: 0.3rem; }
.auth-card input { font-size: 0.9rem; }
.auth-card .checkbox-line { justify-content: center; }
.auth-error { color: #f87171; font-size: 0.85rem; }
.auth-switch { font-size: 0.82rem; color: var(--text-muted); text-align: center; }
.auth-switch a { color: var(--accent); }
.register-form, .regilogin-form, .forgotpass-form { display: flex; flex-direction: column; gap: 0.9rem; width: 100%; }

/* ===== Error page ===== */
.error-card { text-align: center; gap: 0.5rem; }
.error-code { font-weight: 900; font-size: 1.5rem; }

/* ===== Project page ===== */
.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}
.project-tabs {
    display: flex;
    gap: 0.3rem;
    margin: 1.5rem 0 1rem;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}
.project-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.project-tab-btn.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.project-tab-btn:hover:not(.active) { color: var(--text); }
.files-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.file-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.file-list .file-list-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
}
.file-title { font-weight: bold; }
.file-format {
    background: var(--border);
    color: var(--text-muted);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
}
.file-date { margin-left: auto; color: var(--text-muted); font-size: 0.78rem; }
.source-download-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
    background: var(--border); color: var(--text-muted); border-radius: 6px; flex-shrink: 0;
}
.source-download-btn:hover { background: var(--accent); color: var(--text-btn); }
.file-word-count { color: var(--text-muted); font-size: 0.78rem; }
.file-exports {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
	flex-direction: column;
}
.export-lang-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.25rem 0.5rem;
}
.export-lang-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}
.export-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--status-approved);
    text-decoration: none;
    font-size: 0.75rem;
	border-left: 1px dashed var(--border);
	padding-left: 0.35rem;
}
.export-link:hover { filter: brightness(1.25); text-decoration: underline; background: none; color: inherit; }
.export-link-draft { color: var(--text-muted); }
.export-link-translate { color: var(--status-translated); }
.export-link .btn-icon { width: 13px; height: 13px; }
.public-prjct-fltr { margin-bottom: 1rem; }
.invite-form { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.public-prjct-fltr .invite-form { margin-bottom: 0; }
.invite-form select, .invite-form input[type="text"], .invite-form input[type="email"] {
    flex: 1 1 160px;
    min-width: 0;
    max-width: 100%;
}
#invite-result {
    margin-top: 0.75rem;
    font-family: monospace;
    font-size: 0.82rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    word-break: break-all;
}
#invite-result:empty { display: none; }

dialog {
	margin: auto;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
}
dialog::backdrop { background: rgba(0, 0, 0, 0.6); }
.dialogue-content { padding: 1.5rem; }
.import-dialog-form { display: flex; flex-direction: column; gap: 0.8rem; }
.import-dialog-meta { color: var(--text-muted); font-size: 0.82rem; }
.import-dialog-form label { font-size: 0.85rem; }
.import-dialog-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 0.5rem; }
.import-dialog-actions[hidden] { display: none; }
#import-result { font-size: 0.85rem; color: var(--text-muted); }
.import-trigger {
	background: none; border: none; font-weight: normal;
	border-left: 1px dashed var(--border);
	padding: 0; padding-left: 0.35rem; cursor: pointer;
}
.manager-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.request-translator .manager-list { margin-bottom: 0; }
.manager-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}
.manager-empty { color: var(--text-muted); font-style: italic; border: none; background: none; }
.remove-manager-btn {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 0.2rem;
}
.remove-manager-btn:hover { background: var(--danger); color: white; }
.language-row-wrapper { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.language-row-wrapper .language-row { flex: 1; margin-bottom: 0; }
.archive-language-btn {
    background: var(--border); color: var(--text-muted); border: none;
    border-radius: 6px; padding: 0.5rem; cursor: pointer; flex-shrink: 0;
}
.success-btn:hover { background: var(--success); color: var(--text-btn); }
.archive-language-btn:hover, .danger-btn:hover { background: var(--danger); color: var(--text); }
.danger-zone .danger-btn:disabled { opacity: 0.5; }
.danger-zone .danger-btn { background: var(--danger); color: var(--text); }
.danger-zone .danger-btn:hover { background: var(--danger-hover); color: var(--text); }

.status-badge {
    font-size: 0.75rem; padding: 0.2rem 0.6rem; border-radius: 999px;
    font-weight: 500; border: 1px solid; order: 99; margin-left: auto;
}
.status-badge.pending { background: color-mix(in srgb, var(--warning) 15%, transparent); color: var(--warning); }
.status-badge.accepted { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.status-badge.declined { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.btn.join-request-btn { padding: 0.5rem 1rem; }

.subsection-title { font-size: 0.85rem; color: var(--text-muted); margin: 1rem 0 0.5rem; }
.archived-language-list { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.archived-language-list li {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
    padding: 0.5rem 0.75rem; font-size: 0.8rem; color: var(--text-muted);
}
.restore-language-btn, .restore-string-btn {
    background: var(--accent); color: var(--text-btn); border: none; border-radius: 6px;
    padding: 0.3rem 0.7rem; font-size: 0.78rem; cursor: pointer; flex-shrink: 0;
}
.restore-language-btn:hover, .restore-string-btn:hover { background: var(--status-approved); }
.string-row.is-archived .string-translation { display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.restore-string-btn, .delete-forever-btn { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; padding: 0.5rem 1rem; }
.delete-forever-btn { background: var(--danger); color: var(--text); }
.delete-forever-btn:hover { background: var(--danger-hover); color: var(--text); }
.new-language-catalog { margin-top: 0.75rem; font-size: 0.85rem; color: var(--text-muted); }
.new-language-catalog summary { cursor: pointer; }
.new-language-catalog .invite-form { margin-top: 0.6rem; }

/* ===== Upload Page ===== */
.upload-form {
	display: flex;
	gap: 0.75rem;
	flex-wrap: wrap;
	margin-bottom: 1rem;
	flex-direction: column;
}

.marginbtm1 { margin-bottom: 1rem; }

/* ========================================
   MODAL SYSTEM
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: color-mix(in srgb, var(--bg) 75%, transparent);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

.modal-container {
    background: color-mix(in srgb, var(--surface) 95%, transparent);
    backdrop-filter: blur(10px);
    border: 2px solid var(--accent);
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px color-mix(in srgb, var(--accent) 40%, transparent);
    max-width: 1000px;
    width: fit-content;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--accent);
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
    transition: 0.2s ease;
    line-height: 1;
}
.modal-close:hover {
    background: var(--danger);
    color: white;
}

.modal-body { padding: 1.5rem; }

.modal-text {
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.modal-input {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    margin-bottom: 1rem;
	max-height: 50vh;
	field-sizing: content;
	resize: vertical;
    transition: 0.2s ease;
}
.modal-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.modal-select-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
    max-height: 350px;
    overflow-y: auto;
}
.modal-select-item {
    padding: 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: 0.2s ease;
    font-weight: 500;
    font-size: 0.85rem;
}
.modal-select-item:hover {
    border-color: var(--accent);
    background: var(--surface-hover);
}
.modal-select-item.selected {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 20%, var(--bg));
    box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 40%, transparent);
}

.modal-multiselect-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
    max-height: 300px;
    overflow-y: auto;
}
.modal-multiselect-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    font-size: 0.85rem;
    cursor: pointer;
}
.modal-multiselect-item:hover { border-color: var(--accent); }

.modal-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.modal-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
    font-size: 0.9rem;
}
.modal-btn.disabled, .modal-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.modal-btn-cancel {
    background: var(--border);
    color: var(--text);
}
.modal-btn-cancel:hover { background: var(--surface-hover); color: var(--accent); }

.modal-btn-confirm {
    background: var(--accent);
    color: var(--text-btn);
}
.modal-btn-confirm:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 0 15px color-mix(in srgb, var(--accent) 40%, transparent);
}
.modal-btn-confirm:disabled { opacity: 0.4; cursor: not-allowed; }

.icon-missing {
    font-size: 1rem;
    opacity: 0.6;
}

/* ===== Create Project New ===== */
.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.project-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 480px;
}
.project-form label {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}
.project-form input[type="text"],
.project-form textarea,
.project-form select {
    width: 100%;
}
.project-form textarea { resize: vertical; font-family: inherit; }

.target-languages-fieldset {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}
.target-languages-fieldset legend {
    padding: 0 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.checkbox-line {
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.3rem 0;
}
.checkbox-line-wrap {
    align-items: flex-start !important;
}
.checkbox-line-wrap input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 0.25rem;
}
.checkbox-line-wrap code {
    font-size: 0.85em;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 0.05em 0.4em;
    border-radius: 4px;
    white-space: nowrap;
}

.form-errors {
    background: color-mix(in srgb, var(--danger) 15%, transparent);
    border: 1px solid var(--danger);
    color: var(--danger);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

/* ===== Members Page ===== */
.members-filter { margin-bottom: 1rem; }
.members-table {
    width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 10px; overflow: hidden;
}
.table-scroll {
    width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border); border-radius: 10px;
}
.team-list {
	list-style: none; display: flex; flex-direction: column; gap: 0.4rem; margin: 0 0 1rem;
	background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem;
}
.team-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.team-list li:not(:first-child) { border-top: 1px solid var(--border); padding-top: 0.4rem; }
.team-name { font-weight: 600; font-size: 0.85rem; }
.team-email { font-size: 0.8rem; color: var(--text-muted); }
.team-langs { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-left: auto; }
.role-chip, .lang-chip {
    display: inline-block; font-size: 0.7rem; background: var(--border);
    padding: 0.1rem 0.5rem; border-radius: 4px;
}
.role-chip { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); font-weight: 700; }
.lang-chip.is-proofreader { border: 1px solid var(--accent); color: var(--accent); }
.invite-sec-content { display: flex; flex-direction: column; gap: 0.5rem; }
.table-scroll .members-table { margin-bottom: 0; }
.members-table th, .members-table td {
    padding: 0.65rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}
.members-table th { color: var(--text-muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; }
.members-table tr:last-child td { border-bottom: none; }
.member-email { color: var(--text-muted); font-size: 0.75rem; }
.member-empty { text-align: center; color: var(--text-muted); padding: 1.5rem; }
.autocomplete-wrapper { position: relative; }
.autocomplete-results {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0;
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
    max-height: 220px; overflow-y: auto; z-index: 30;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.autocomplete-item { padding: 0.5rem 0.75rem; cursor: pointer; font-size: 0.85rem; }
.autocomplete-item:hover { background: var(--border); }
.autocomplete-email { color: var(--text-muted); font-size: 0.75rem; margin-left: 0.4rem; }
.autocomplete-empty { padding: 0.5rem 0.75rem; color: var(--text-muted); font-size: 0.85rem; }
.theme-select-list { 
	display: flex; gap: 0.15rem; margin-bottom: 1rem; width: fit-content;
	background: var(--bg); padding: 0.25rem; border: 1px solid var(--border); border-radius: 10px;
}
.language-select-list {
    display: flex; flex-direction: column; gap: 0.15rem; margin-bottom: 1rem; max-height: 360px; overflow-y: auto;
	background: var(--bg); padding: 0.25rem; border: 1px solid var(--border); border-radius: 10px;
}
.language-select-row, .theme-select-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}
.language-select-row:hover, .theme-select-row:hover { background: color-mix(in srgb, var(--text-muted) 8%, transparent); color: var(--text); }
.language-select-row.is-selected, .theme-select-row.is-selected { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--text); }
.language-select-row input[type="checkbox"], .theme-select-row input[type="radio"] { display: none; }
.language-select-row input[type="checkbox"]::before { content: ""; }

.language-code-tag { color: var(--text-muted); font-size: 0.78rem; }
.hint-text { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 0.75rem; }
.form-success {
    background: color-mix(in srgb, var(--status-approved) 15%, transparent);
    border: 1px solid var(--status-approved); color: var(--status-approved);
    border-radius: 8px; padding: 0.6rem 1rem; margin-bottom: 1rem; font-size: 0.85rem;
}
.request-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.5rem; }
.request-list li {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
    padding: 0.6rem 1rem; font-size: 0.85rem;
}
.request-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.profile-info { margin-bottom: 1.5rem; }
.profile-form { max-width: 480px; }
.profile-form input { width: 100%; }

/* ===== Pages légales ===== */
.legal-body { display: flex; justify-content: center; padding: 3rem 1.5rem; }
.legal-page { max-width: 720px; width: 100%; line-height: 1.65; }
.legal-page h1 { margin-bottom: 0.2rem; }
.legal-page h2 { font-size: 1.1rem; margin-top: 2rem; margin-bottom: 0.5rem; }
.legal-page p, .legal-page ul { color: var(--text-muted); margin-bottom: 0.9rem; }
.legal-page ul { padding-left: 1.3rem; }
.legal-updated { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.legal-links { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.85rem; text-align: center; }
.auth-legal-links { text-align: center; margin-top: 1rem; font-size: 0.75rem; padding-top: 0; border-top: none; }
.sidebar-legal-link {
    display: block; text-align: center; font-size: 0.7rem;
    color: var(--text-muted); margin-top: 0.5rem; text-decoration: none;
}
.sidebar-legal-link a { text-decoration: none; }
.sidebar-legal-link a:hover { color: var(--text); text-decoration: underline; }


/* ===== Lang Switcher ===== */
.lang-switcher { margin-top: 1rem; text-align: center; }
.lang-switcher select {
    background: var(--bg); border: 1px solid var(--border); color: var(--text);
    padding: 0.3rem 0.5rem; border-radius: 6px; font-size: 0.8rem; max-width: 100%;
}
.landing-footer .lang-switcher { margin-top: 0; }

/* ===== Landing page ===== */
.landing-body {
    min-height: 100vh; display: flex; flex-direction: column;
    /* léger halo "lune" en haut de page, suit la couleur d'accent du thème */
    background:
        radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%) center top / 100% 640px no-repeat,
        var(--bg);
}
.landing-nav {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; max-width: 1100px; margin: 0 auto; padding: 1rem 1.5rem;
}
.landing-brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; font-size: 1.1rem; }
.landing-main { flex: 1; width: 100%; max-width: 1000px; margin: 0 auto; padding: 0 1.25rem; }

/* Hero */
.landing-hero {
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
    gap: 0.75rem; text-align: center; padding: 2rem 0 2rem;
}
.landing-hero h1 {
    flex-basis: 100%; padding: 0 6%;
    font-size: clamp(1.9rem, 4.5vw, 2.8rem); line-height: 1.15; text-wrap: balance;
}
.landing-hero .hint-text {
    flex-basis: 100%; padding: 0 14%; margin: 0.25rem 0 0.75rem;
    font-size: 1rem; line-height: 1.5;
}
.landing-hero .btn, .landing-hero .discord-link {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    height: 3rem; width: auto; margin: 0; padding: 0 1.5rem; font-size: 1rem; border-radius: 6px;
}
.landing-hero .discord-link { font-weight: 700; }
.landing-hero .discord-link:hover { background: var(--surface-hover); }

/* Capture d'écran (optionnelle) */
.landing-shot {
    display: block; width: 100%; max-width: 900px; margin: 0 auto 3rem;
    border: 1px solid var(--border); border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

/* Cartes d'avantages */
.landing-features {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem; margin: 1rem 0 3rem;
}
.landing-features .base-box { transition: transform var(--transition-fast), border-color var(--transition-fast); }
.landing-features .base-box:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.landing-features h2.section-title { margin: 0 0 0.6rem; font-size: 0.9rem; color: var(--accent); }
.landing-features .hint-text { margin: 0; font-size: 0.88rem; line-height: 1.5; }

/* Formulaire de demande d'accès */
.landing-request { max-width: 520px; margin: 0 auto; padding-bottom: 3rem; scroll-margin-top: 1.5rem; }
.landing-request h2.section-title { margin-top: 0; font-size: 1.3rem; color: var(--text); text-transform: none; }
.landing-request h2.section-title, .landing-request > .hint-text { text-align: center; }
#access-form { display: flex; flex-direction: column; gap: 0.9rem; padding: 1.5rem; }
#access-form label { flex-direction: column; align-items: stretch; gap: 0.3rem; }
#access-form input, #access-form select, #access-form textarea { width: 100%; font-size: 0.9rem; }
#access-form textarea { resize: vertical; font-family: inherit; }
#access-form .btn { width: 100%; cursor: pointer; }
#access-form .btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
#access-status { margin: 0; min-height: 1.2em; text-align: center; }

/* Pied de page */
.landing-footer {
    display: flex; flex-direction: column; align-items: center; gap: 0.75rem; background: var(--surface);
    padding: 2rem 1rem; border-top: 1px solid var(--border); font-size: 0.8rem;
}
.landing-footer .discord-link {
    display: flex; align-items: center; gap: 0.5rem; margin: 0;
    width: fit-content; padding: 0 1rem; font-weight: 700;
}
.landing-footer a:not(.discord-link) { color: var(--text-muted); }
.landing-footer a:not(.discord-link):hover { color: var(--accent); }

/* ===== Glossary ===== */
.glossary-nav-link { float: right; }
.glossary-add-form form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.glossary-add-form input[type="text"] { flex: 1; min-width: 200px; }
.glossary-term { margin: 1rem 0; }
.glossary-term-head { display: flex; align-items: center; gap: 0.6rem; }
.glossary-term-head .glossary-trash-action { margin-left: auto; }
.glossary-translations { width: 100%; margin-top: 0.6rem; border-collapse: collapse; }
.glossary-translations td { padding: 0.3rem 0; border-top: 1px solid var(--border); }
.glossary-lang-code { width: 4rem; color: var(--text-muted); font-family: monospace; text-transform: uppercase; }
.glossary-inline-action { display: flex; gap: 0.4rem; }
.glossary-inline-action input[type="text"] { flex: 1; }
.glossary-term .hint-text { margin: 0; }
.string-context {
    display: inline-block; font-size: 0.7rem; background: var(--border);
    padding: 0.1rem 0.5rem; border-radius: 4px;
}
.glossary-add-form form, .glossary-edit-term-form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.glossary-add-form input[type="text"], .glossary-edit-term-form input[type="text"] { flex: 1; min-width: 160px; }
.glossaries-sec-content { display: flex; flex-direction: column; gap: 1rem; }
.glossaries-list {
	display: flex; flex-direction: column; gap: 0.15rem; max-height: 360px; overflow-y: auto;
	background: var(--bg); padding: 0.5rem; border: 1px solid var(--border); border-radius: 10px;
}
.glossaries-list .glossary-term-head { padding: 0.5rem; }
.glossaries-list .glossary-term-head:not(:first-child) { border-top: 2px dashed var(--border) }
.translation-form {
    position: relative;
}
.translation-form .icon-btn { border: 1px solid transparent; }
.translation-form.saved .icon-btn {
    border: 1px solid var(--success);
    color: var(--success);
}
.translation-form.save-error .icon-btn {
    border: 1px solid var(--danger);
    color: var(--danger);
}
.save-toast {
    position: absolute;
    top: 0.5em;
    right: 2.5em;
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 4px;
    background: color-mix(in srgb, var(--success) 15%, transparent);
    color: var(--success);
	border: 1px solid var(--success);
    white-space: nowrap;
    opacity: 0;
    transform: translateX(10px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.translation-form.saved .save-toast {
    opacity: 1;
    transform: translateX(0);
}

/* ===== Help / FAQ ===== */
.faq-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.faq-section { scroll-margin-top: 1rem; }
.faq-quickstart ol { margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: 0.4rem; }

.faq-list { padding: 0; overflow: hidden; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
    padding: 0.9rem 1.1rem; font-weight: 600; cursor: pointer; list-style: none;
    transition: background var(--transition-fast);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; flex-shrink: 0; font-size: 1.2rem; color: var(--accent); }
.faq-item[open] summary::after { content: '\2212'; }
.faq-item summary:hover { background: var(--surface-hover); }
.faq-item[open] summary { color: var(--accent); }
.faq-answer { padding: 0 1.1rem 1rem; font-size: 0.9rem; line-height: 1.55; color: var(--text-muted); }

/* ===== Above all ===== */
td:has(.remove-member-btn), td:has(.remove-manager-row-btn) { text-align: right; }

/* ===== Responsive : barre mobile + sidebar en tiroir ===== */
.mobile-topbar { display: none; }
.sidebar-overlay { display: none; }

@media (max-width: 768px) {
    .mobile-topbar {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        position: sticky;
        top: 0;
        z-index: 40;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        padding: 0.75rem 1rem;
    }
    .sidebar-toggle-btn {
        background: none;
        border: none;
        color: var(--text);
        display: flex;
        padding: 0.3rem;
        cursor: pointer;
    }
    .sidebar-toggle-btn .sidebar-icon { width: 22px; height: 22px; }
    .mobile-topbar-title {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        font-weight: 600;
    }
    .mobile-topbar-title .sidebar-logo-icon { width: 22px; height: 22px; }

    .app-shell { min-height: calc(100vh - 53px); }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
        overflow-y: auto;
    }
    .sidebar.open { transform: translateX(0); }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 45;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.22s ease;
    }
    .sidebar-overlay.visible { opacity: 1; pointer-events: auto; }

    .app-main { padding: 1rem; }
}

@media (max-width: 600px) {
    .landing-nav { padding: 0.75rem 1rem; }
    .landing-hero { padding: 1.5rem 0 1.5rem; }
    .landing-hero h1, .landing-hero .hint-text { padding-inline: 0; }
    .landing-hero .btn, .landing-hero .discord-link { width: 100%; }
}