:root {
  color-scheme: dark;
  --bg: #090b10;
  --surface: #11141b;
  --surface-2: #171b24;
  --border: #252b37;
  --text: #edf0f7;
  --muted: #8f98aa;
  --accent: #6c72ff;
  --accent-soft: rgba(108, 114, 255, .14);
  --green: #38d996;
  --red: #ff6b7a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 80% -10%, #171a31 0, transparent 32%), var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px; border-right: 1px solid var(--border); background: rgba(12, 14, 20, .92); display: flex; flex-direction: column; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 12px; font-weight: 800; letter-spacing: .2em; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #444bff; border-radius: 12px; background: linear-gradient(145deg, #7b80ff, #3c42d7); color: white; letter-spacing: -.05em; box-shadow: 0 9px 30px rgba(91, 97, 255, .24); }
.brand.large { margin-bottom: 36px; }
.brand.large .brand-mark { width: 46px; height: 46px; }
.nav { display: grid; gap: 7px; margin-top: 42px; }
.nav a { display: flex; align-items: center; gap: 13px; padding: 11px 13px; color: var(--muted); border-radius: 10px; font-size: 14px; }
.nav a:hover, .nav a.active { color: white; background: var(--surface-2); }
.nav a.active { box-shadow: inset 2px 0 var(--accent); }
.logout { margin-top: auto; }
.logout button, .link-button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 8px; }
.logout button:hover, .link-button:hover { color: white; }
.main { min-width: 0; padding: 0 42px 48px; }
.topbar { min-height: 112px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); margin-bottom: 30px; }
.topbar h1 { margin: 3px 0 0; font-size: clamp(24px, 3vw, 32px); letter-spacing: -.04em; }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.account { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.account-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.page-section { margin-bottom: 24px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
input, select, textarea { min-height: 40px; padding: 0 12px; color: var(--text); background: #0d1016; border: 1px solid var(--border); border-radius: 9px; outline: none; }
textarea { padding: 12px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="search"] { min-width: 220px; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 0 16px; border: 1px solid transparent; border-radius: 9px; color: white; background: var(--accent); cursor: pointer; font-weight: 700; font-size: 13px; }
.button.secondary { background: var(--surface-2); border-color: var(--border); }
.button.discord { background: #5865f2; min-width: 210px; }
.button.danger { background: rgba(255,107,122,.12); border-color: rgba(255,107,122,.35); color: #ff9aa4; }
.button.danger:hover { background: rgba(255,107,122,.2); }
.inline-form { display: inline; margin: 0; }
.notice { padding: 13px 16px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; }
.notice.success { color: #8ce9be; background: rgba(56,217,150,.08); border-color: rgba(56,217,150,.25); }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 13px; }
.metric, .panel, .ticket-meta, .conversation { border: 1px solid var(--border); background: linear-gradient(145deg, rgba(23,27,36,.93), rgba(15,18,24,.94)); border-radius: 14px; }
.metric { min-height: 112px; padding: 19px; display: flex; flex-direction: column; justify-content: space-between; }
.metric::before { content: ""; width: 24px; height: 2px; background: #4d5568; }
.metric.accent::before { background: var(--green); }
.metric.danger::before { background: var(--red); }
.metric span { color: var(--muted); font-size: 12px; }
.metric strong { font-size: 22px; letter-spacing: -.04em; }
.metric strong small { display: block; font-size: inherit; }
.metric .text-value { font-size: 18px; }
.split-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.panel { padding: 21px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.panel-heading h2 { margin: 4px 0 0; font-size: 16px; }
.panel-heading > a, .panel-heading > span { color: var(--muted); font-size: 12px; }
.queue-list, .compact-list { display: grid; }
.queue-item { display: grid; grid-template-columns: 34px 1fr 10px; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.queue-item > span { color: #626b7d; font-family: ui-monospace, monospace; }
.queue-item div { display: grid; gap: 3px; }
.queue-item small, .compact-list small, td small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.queue-item i { width: 8px; height: 8px; border-radius: 50%; background: #4b5261; }
.queue-item i.busy { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.compact-list > div, .compact-list > a { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); font-size: 13px; }
.compact-list .right { text-align: right; }
.empty { color: var(--muted); text-align: center; padding: 25px 10px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 12px; color: var(--muted); text-align: left; font-size: 10px; letter-spacing: .09em; text-transform: uppercase; border-bottom: 1px solid var(--border); }
td { padding: 14px 12px; border-bottom: 1px solid rgba(37,43,55,.7); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.clickable a { font-weight: 700; }
.chart-list { display: grid; gap: 20px; }
.chart-row { display: grid; grid-template-columns: 130px 1fr; gap: 20px; align-items: center; }
.chart-row > strong { text-transform: capitalize; font-size: 12px; }
.chart-row > div { display: grid; gap: 9px; }
.chart-row label { display: grid; grid-template-columns: 70px 1fr 110px; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
progress { width: 100%; height: 7px; border: 0; border-radius: 10px; overflow: hidden; background: #262b37; }
progress::-webkit-progress-bar { background: #262b37; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 10px; }
progress::-moz-progress-bar { background: var(--accent); }
progress.pending::-webkit-progress-value { background: #d6a54b; }
.ticket-meta { padding: 22px; }
.transcript-delete { float: right; }
.back { color: var(--muted); font-size: 12px; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 18px; margin-top: 20px; }
.meta-grid div { display: grid; gap: 5px; }
.meta-grid span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.meta-grid strong { font-size: 13px; overflow-wrap: anywhere; }
.warning { padding: 13px 16px; color: #ffd18a; background: rgba(214,165,75,.1); border: 1px solid rgba(214,165,75,.3); border-radius: 10px; font-size: 12px; }
.conversation { padding: 12px 0; }
.discord-message { display: grid; grid-template-columns: 42px 1fr; gap: 14px; padding: 13px 22px; }
.discord-message:hover { background: rgba(255,255,255,.018); }
.discord-message > img, .avatar-fallback { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.avatar-fallback { display: grid; place-items: center; background: var(--accent-soft); color: #aeb2ff; font-weight: 800; }
.message-body { min-width: 0; }
.message-body header { display: flex; align-items: center; gap: 8px; }
.message-body header b { padding: 2px 5px; color: white; background: var(--accent); border-radius: 3px; font-size: 9px; }
.message-body time { color: var(--muted); font-size: 10px; }
.message-content { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0; color: #d8dce6; line-height: 1.5; font-size: 13px; }
.discord-embed { max-width: 620px; margin-top: 9px; padding: 13px; border-left: 3px solid var(--accent); border-radius: 4px 9px 9px 4px; background: #0e1117; }
.discord-embed p { white-space: pre-wrap; margin: 5px 0; color: #cdd2dc; }
.discord-embed div { display: grid; gap: 3px; margin-top: 8px; }
.discord-embed span { white-space: pre-wrap; color: #cdd2dc; }
.attachment { display: grid; justify-items: start; gap: 5px; margin-top: 9px; }
.attachment img { max-width: min(520px, 100%); max-height: 420px; border-radius: 9px; }
.attachment a { color: #aeb2ff; }
.attachment small { color: var(--muted); }
.source-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.source-form label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; }
.source-form .button { grid-column: 1 / -1; }
.source-list { margin-top: 18px; }
.source-list > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-top: 1px solid var(--border); }
.source-list form { display: flex; align-items: center; gap: 8px; }
.source-list input { min-width: 0; width: 145px; }
code { color: #aeb2ff; font-size: 11px; }
.danger-text { color: var(--red); }
.ranking { display: grid; gap: 16px; }
.ranking > div { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(80px, 2fr) 35px; align-items: center; gap: 12px; }
.ranking span { display: flex; gap: 10px; font-size: 12px; }
.ranking span b { color: #626b7d; font-family: ui-monospace, monospace; }
.ranking em { color: var(--muted); font-style: normal; text-align: right; }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(420px, 100%); padding: 38px; border: 1px solid var(--border); border-radius: 18px; background: rgba(17,20,27,.94); box-shadow: 0 30px 100px rgba(0,0,0,.35); }
.auth-card h1 { margin: 8px 0; font-size: 30px; letter-spacing: -.04em; }
.auth-card p { color: var(--muted); line-height: 1.6; }
.auth-card > small { display: block; color: #687184; margin-top: 15px; }
.error-mark { display: grid; place-items: center; width: 45px; height: 45px; color: var(--red); background: rgba(255,107,122,.1); border-radius: 50%; font-size: 28px; margin-bottom: 24px; }
.empty-state { min-height: 55vh; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--muted); }
.empty-state > strong { font-size: 80px; color: #222836; }
.announcement-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); align-items: start; gap: 20px; }
.announcement-composer, .announcement-preview-panel { min-width: 0; }
.announcement-form { display: grid; gap: 18px; }
.announcement-form label { min-width: 0; }
.announcement-form > label, .announcement-field-row > label { display: grid; gap: 8px; color: var(--muted); font-size: 12px; }
.announcement-form label > span:first-child, .announcement-upload strong { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--text); font-weight: 700; }
.announcement-form label small, .announcement-upload small { display: block; color: #747e92; font-weight: 500; line-height: 1.45; }
.announcement-field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .72fr); gap: 14px; }
.announcement-form input:not([type="checkbox"]), .announcement-form select, .announcement-form textarea { width: 100%; }
.announcement-upload { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 13px 18px; padding: 16px; border: 1px dashed #343c4e; border-radius: 12px; background: rgba(9,11,16,.36); }
.announcement-upload > div:first-child { display: grid; gap: 5px; }
.announcement-upload input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.file-picker { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; padding: 0 15px; border: 1px solid #3a4255; border-radius: 9px; color: white; background: var(--surface-2); cursor: pointer; font-size: 12px; font-weight: 750; }
.file-picker:hover { border-color: var(--accent); background: var(--accent-soft); }
.file-summary { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.file-summary.has-files { color: #aeb2ff; }
.announcement-form .check-field { display: flex; align-items: flex-start; gap: 11px; padding: 13px 15px; border: 1px solid var(--border); border-radius: 11px; background: rgba(9,11,16,.28); cursor: pointer; }
.announcement-form .check-field input { flex: 0 0 auto; min-height: 0; width: 17px; height: 17px; margin-top: 2px; }
.announcement-form .check-field span { display: grid; gap: 3px; }
.announcement-form .check-field span strong { color: var(--text); }
.announcement-form .translation-toggle { border-color: rgba(108,114,255,.34); background: var(--accent-soft); }
.announcement-english-fields { display: grid; gap: 15px; padding: 17px; border: 1px solid rgba(108,114,255,.34); border-radius: 12px; background: rgba(108,114,255,.07); }
.announcement-english-fields > label { display: grid; gap: 8px; color: var(--muted); font-size: 12px; }
.announcement-language-heading { display: flex; align-items: center; gap: 11px; padding-bottom: 13px; border-bottom: 1px solid rgba(108,114,255,.2); }
.announcement-language-heading > span { font-size: 24px; }
.announcement-language-heading > div { display: grid; gap: 3px; }
.announcement-language-heading small, .bilingual-limit { color: var(--muted); font-size: 10px; }
.bilingual-limit { display: block; line-height: 1.5; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; margin-top: 8px; }
.form-actions form { margin: 0; }
.form-error { min-height: 18px; margin: 0; color: var(--red); font-size: 12px; }
.announcement-preview-panel { position: sticky; top: 22px; }
.discord-preview-shell { min-height: 300px; padding: 18px; border: 1px solid #252a35; border-radius: 12px; background: #1a1c20; }
.discord-preview-author { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.discord-preview-author > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: white; background: #5865f2; font-size: 11px; font-weight: 850; }
.discord-preview-author > div { display: grid; gap: 2px; }
.discord-preview-author strong { font-size: 13px; }
.discord-preview-author small { color: #9da4b3; font-size: 9px; }
.preview-everyone { display: inline-block; margin: 2px 0 8px 48px; padding: 1px 3px; border-radius: 3px; color: #c9cdfb; background: rgba(88,101,242,.28); font-size: 13px; }
.announcement-preview { max-width: 580px; overflow: hidden; margin-left: 48px; padding: 15px; border-left: 4px solid var(--accent); border-radius: 4px; background: #202225; }
.announcement-preview-translate-menu { max-width: 580px; margin: 10px 0 0 48px; padding: 10px 14px; border: 1px solid #3a3f4b; border-radius: 8px; background: #2b2d31; color: #b5bac1; font-size: 13px; }
.announcement-preview > strong { display: block; margin-bottom: 10px; font-size: 17px; }
.announcement-preview > p, .announcement-detail-message { white-space: pre-wrap; overflow-wrap: anywhere; color: #d8dce6; line-height: 1.55; }
.preview-images, .detail-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 14px; }
.preview-images:empty { display: none; }
.preview-images img, .detail-images img { width: 100%; max-height: 300px; object-fit: cover; border-radius: 7px; background: #090b10; }
.preview-images img:only-child, .detail-images img:only-child { grid-column: 1 / -1; max-height: 440px; object-fit: contain; }
.announcement-detail-message { margin: 22px 0; padding: 16px; border-radius: 10px; background: #0d1016; }
.status { display: inline-flex; padding: 4px 8px; border-radius: 20px; background: var(--surface-2); color: var(--muted); font-size: 11px; }
.status-sent { color: #8ce9be; background: rgba(56,217,150,.1); }
.status-failed { color: #ff9aa4; background: rgba(255,107,122,.1); }
.status-processing { color: #aeb2ff; background: var(--accent-soft); }
.status-pending { color: #ffd18a; background: rgba(214,165,75,.1); }
.content-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.content-header h2 { margin: 5px 0 7px; }
.content-header p { max-width: 720px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.content-sync { flex: 0 0 auto; display: grid; gap: 4px; min-width: 170px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 12px; }
.content-sync small { color: var(--muted); }
.content-sync.status-applied { color: #8ce9be; border-color: rgba(56,217,150,.3); background: rgba(56,217,150,.07); }
.content-sync.status-pending { color: #ffd18a; border-color: rgba(214,165,75,.3); background: rgba(214,165,75,.07); }
.content-sync.status-failed { color: #ff9aa4; border-color: rgba(255,107,122,.3); background: rgba(255,107,122,.07); }
.content-tabs { display: flex; gap: 7px; margin: 20px 0; padding: 5px; width: fit-content; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.content-tabs a { padding: 9px 17px; border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.content-tabs a:hover, .content-tabs a.active { color: white; background: var(--surface-2); }
.content-editor { display: grid; gap: 16px; }
.content-editor input, .content-editor textarea { width: 100%; }
.content-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.content-editor label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; }
.content-language { padding: 0; overflow: hidden; }
.content-language > summary { display: flex; align-items: center; justify-content: space-between; padding: 19px 21px; cursor: pointer; list-style: none; font-weight: 800; }
.content-language > summary::-webkit-details-marker { display: none; }
.content-language > summary::after { content: '+'; color: var(--muted); font-size: 18px; }
.content-language[open] > summary::after { content: '−'; }
.content-language > summary small { margin-left: auto; margin-right: 15px; color: var(--muted); font-size: 10px; font-weight: 500; }
.content-language-body { display: grid; gap: 17px; padding: 0 21px 23px; border-top: 1px solid var(--border); }
.content-language-body > label:first-child { margin-top: 20px; }
.content-block { display: grid; gap: 13px; margin: 0; padding: 16px; border: 1px solid var(--border); border-radius: 11px; background: rgba(9,11,16,.4); }
.content-block legend { padding: 0 7px; color: #aeb2ff; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.term-block textarea { min-height: 190px; }
.content-save-bar { position: sticky; bottom: 12px; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px; border: 1px solid #343b50; border-radius: 12px; background: rgba(17,20,27,.96); box-shadow: 0 14px 45px rgba(0,0,0,.35); backdrop-filter: blur(12px); }
.content-save-bar span { color: var(--muted); font-size: 11px; }
.compact-empty { min-height: 320px; }
.compact-empty strong { font-size: 48px; }
.compact-empty h2, .compact-empty p { margin: 0; }
.about-editor-intro h2 { margin: 5px 0 8px; }
.about-editor-intro p { max-width: 760px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.about-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; }
.about-language-editor { min-width: 0; }
.about-language-editor .panel-heading small { color: var(--muted); font-size: 10px; }
.about-language-editor label { display: grid; gap: 8px; color: var(--muted); font-size: 11px; }
.about-complete-text { min-height: 560px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; line-height: 1.6; }

@media (max-width: 1180px) {
  .announcement-grid { grid-template-columns: 1fr; }
  .announcement-preview-panel { position: static; }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; z-index: 5; height: auto; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--border); flex-direction: row; align-items: center; gap: 14px; }
  .brand > span:last-child { display: none; }
  .brand-mark { width: 34px; height: 34px; }
  .nav { display: flex; flex: 1; justify-content: center; margin: 0; gap: 2px; }
  .nav a { padding: 9px; }
  .nav a span { display: none; }
  .logout { margin: 0; }
  .main { padding: 0 16px 30px; }
  .topbar { min-height: 88px; margin-bottom: 20px; }
  .account { display: none; }
  .split-grid { grid-template-columns: 1fr; }
  .announcement-grid { grid-template-columns: 1fr; }
  .announcement-preview-panel { position: static; }
  .announcement-field-row, .about-editor-grid { grid-template-columns: 1fr; }
  .filter-bar { align-items: stretch; }
  .filter-bar > * { flex: 1 1 140px; }
  .chart-row { grid-template-columns: 1fr; gap: 8px; }
  .chart-row label { grid-template-columns: 60px 1fr 90px; }
  .source-form { grid-template-columns: 1fr; }
  .content-header, .content-save-bar { align-items: stretch; flex-direction: column; }
  .content-field-grid { grid-template-columns: 1fr; }
  .content-tabs { width: 100%; overflow-x: auto; }
  .content-tabs a { flex: 1 0 auto; text-align: center; }
  .discord-message { grid-template-columns: 34px 1fr; padding: 12px; gap: 10px; }
  .discord-message > img, .avatar-fallback { width: 34px; height: 34px; }
}
