/* ============================================================
   TRANSLATION DESK — additions on top of office.css
   ============================================================ */
:root {
  --yellow: #FAC775;
  --thai-font: "Sarabun", "Noto Sans Thai", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --cn-font: "Noto Serif SC", "Songti SC", "PingFang SC", "Microsoft YaHei", serif;
}
body { font-family: var(--thai-font); }
.sep { width: 2px; height: 22px; background: var(--ink); margin: 0 6px; opacity: .25; }
.tab.active { border-color: var(--ink); color: var(--ink); background: var(--yellow); }
.subtab.active { border-bottom-color: var(--ink); color: var(--ink); }
.who-pill { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--ink); padding: 4px 10px; font-size: 12px; background: var(--yellow); }
.syspill .led { width: 8px; height: 8px; border-radius: 50%; background: var(--success); display: inline-block; }
.syspill.bad .led { background: var(--blocked); }
.crumb { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }

.page { max-width: 1400px; margin: 0 auto; }
.pad { padding: 20px 24px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; }
.grow { flex: 1; }
.dim { color: var(--ink-3); }
.hint { color: var(--hint); font-size: 12px; }
.mt { margin-top: 12px; } .mb { margin-bottom: 12px; }
h1, h2, h3 { margin: 0; }
h1 { font-size: 26px; font-weight: 800; letter-spacing: -.3px; }
h2 { font-size: 16px; font-weight: 700; }

.btn-primary { background: var(--ink); color: var(--bg); }
.btn-yellow { background: var(--yellow); }
.btn-danger { background: var(--blocked); color: #fff; border-color: var(--blocked); }
.btn-sm { padding: 5px 9px; font-size: 10px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* status flags */
.flag.st-pending { background: var(--idle); }
.flag.st-queued { background: #E8E4F7; }
.flag.st-translating { background: #E8E4F7; animation: pulse 1.2s infinite; }
.flag.st-translated { background: var(--review); }
.flag.st-reviewing { background: #FFE7B8; }
.flag.st-needs_fix { background: #F7C9C9; }
.flag.st-approved { background: var(--active); }
.flag.st-delivered { background: var(--success); color: #fff; }
.flag.st-failed { background: var(--blocked); color: #fff; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .55 } }

/* forms */
input[type=text], input[type=password], input[type=number], input[type=time], select, textarea {
  font-family: inherit; font-size: 14px; border: 2px solid var(--ink); background: var(--bg); padding: 8px 10px; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--yellow); outline-offset: -1px; }
textarea { width: 100%; resize: vertical; line-height: 1.7; }
label.lbl { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--ink-3); margin: 10px 0 4px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }

/* tables */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); padding: 10px 12px; border-bottom: 2px solid var(--ink); background: var(--softer); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: var(--soft); }
.tbl tr.clickable { cursor: pointer; }
.tbl td.num { font-family: ui-monospace, monospace; text-align: right; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 2px solid var(--ink); background: var(--bg); }
.section-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.section-body { padding: 14px 18px; }
.section.flat { box-shadow: none; }

/* progress */
.bar { height: 14px; border: 2px solid var(--ink); background: var(--bg); position: relative; overflow: hidden; }
.bar > i { position: absolute; top: 0; bottom: 0; left: 0; }
.bar .b-del { background: var(--success); }
.bar .b-app { background: var(--active); }
.bar .b-tr { background: var(--review); }

/* novel cards */
.ncard { border: 4px solid var(--ink); background: var(--bg); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.ncard:hover { transform: translate(-2px,-2px); }
.ncard .head { padding: 12px 16px; border-bottom: 2px solid var(--ink); display: flex; align-items: center; gap: 10px; background: var(--softer); }
.ncard .body { padding: 14px 16px; }
.ncard .foot { padding: 10px 16px; border-top: 2px solid var(--ink); display: flex; gap: 8px; align-items: center; background: var(--soft); flex-wrap: wrap; }
.counts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.counts .flag { font-size: 10px; }
.stat { border: 2px solid var(--ink); padding: 8px 12px; min-width: 110px; }
.stat b { display: block; font-size: 20px; font-weight: 800; }
.stat span { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }

/* editor */
.ed-top { position: sticky; top: 0; z-index: 25; background: var(--bg); border-bottom: 4px solid var(--ink); padding: 10px 24px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ed-top .title { font-size: 16px; font-weight: 800; }
.ed-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 0; }
.ed-main { border-right: 2px solid var(--ink); min-height: 70vh; }
.ed-side { position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 64px); overflow: auto; }
.para { display: grid; grid-template-columns: 36px 1fr 1fr; border-bottom: 1px solid var(--line); }
.para:hover { background: var(--softer); }
.para.has-note { background: #FFF6E0; }
.para.changed .tgt textarea { border-left: 4px solid var(--yellow); }
.para .idx { font-family: ui-monospace, monospace; font-size: 11px; color: var(--hint); padding: 12px 6px; text-align: right; }
.para .src { padding: 12px 14px; font-family: var(--cn-font); font-size: 15px; line-height: 1.9; border-right: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; }
.para .src mark { background: var(--yellow); padding: 0 2px; }
.para .tgt { padding: 8px 10px; }
.para .tgt textarea { width: 100%; border: 2px solid transparent; background: transparent; font-size: 15px; line-height: 1.8; padding: 4px 6px; min-height: 40px; overflow: hidden; }
.para .tgt textarea:hover { border-color: var(--line); }
.para .tgt textarea:focus { border-color: var(--ink); background: var(--bg); outline: none; }
.para .tools { display: flex; gap: 6px; padding: 0 6px 6px; opacity: 0; }
.para:hover .tools, .para:focus-within .tools { opacity: 1; }
.para .tools button { border: 1.5px solid var(--ink); background: var(--bg); font-size: 10px; padding: 2px 7px; cursor: pointer; font-family: inherit; }
.para .notes-inline { grid-column: 2 / 4; padding: 0 14px 10px; }
.note { border: 2px solid var(--ink); background: var(--bg); padding: 8px 10px; margin: 6px 0; font-size: 13px; }
.note.resolved { opacity: .5; text-decoration: line-through; }
.note .meta { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.note .k-fix { background: #F7C9C9; } .note .k-rule { background: var(--yellow); } .note .k-question { background: #E8E4F7; } .note .k-info { background: var(--idle); }
.side-block { border-bottom: 2px solid var(--ink); }
.side-block h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 10px 14px; background: var(--softer); border-bottom: 1px solid var(--line); }
.side-block .in { padding: 10px 14px; font-size: 13px; }
.gl-hit { display: inline-block; border: 1.5px solid var(--ink); padding: 1px 6px; margin: 2px 3px 2px 0; font-size: 12px; background: var(--bg); }
.gl-hit b { font-family: var(--cn-font); }
.mismatch { background: #F7C9C9; border: 2px solid var(--blocked); padding: 8px 12px; font-size: 12px; margin: 10px 24px; }

/* modal + toast */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 60px 16px; overflow: auto; }
.modal { background: var(--bg); border: 4px solid var(--ink); box-shadow: var(--shadow); width: min(720px, 100%); }
.modal-head { padding: 12px 18px; border-bottom: 2px solid var(--ink); display: flex; justify-content: space-between; align-items: center; font-weight: 800; }
.modal-body { padding: 16px 18px; }
#toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { border: 2px solid var(--ink); background: var(--bg); padding: 10px 14px; box-shadow: var(--shadow-sm); font-size: 13px; max-width: 420px; transition: opacity .3s; }
.toast-ok { background: var(--active); } .toast-err { background: var(--blocked); color: #fff; } .toast-warn { background: var(--yellow); }
.toast.out { opacity: 0; }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box { width: 380px; border: 4px solid var(--ink); background: var(--bg); box-shadow: var(--shadow); }
.login-box .head { padding: 16px 20px; border-bottom: 4px solid var(--ink); background: var(--yellow); display: flex; align-items: center; gap: 10px; }
.login-box .body { padding: 20px; }
.login-box input { width: 100%; }

/* activity */
.act { display: grid; grid-template-columns: 110px 1fr auto; gap: 10px; padding: 8px 18px; border-bottom: 1px solid var(--line); font-size: 13px; }
.act .t { color: var(--hint); font-size: 11px; }

/* preview split table */
.split-list { max-height: 320px; overflow: auto; border: 2px solid var(--ink); }
.chk { width: 16px; height: 16px; accent-color: var(--ink); }
.diffbox { font-size: 13px; border: 2px solid var(--ink); }
.diffbox .d { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.diffbox .d > div { padding: 8px 10px; white-space: pre-wrap; }
.diffbox .old { background: #FBE9E9; } .diffbox .new { background: #E6F4EA; }
@media (max-width: 900px) {
  .ed-wrap { grid-template-columns: 1fr; } .ed-side { position: static; max-height: none; }
  .para { grid-template-columns: 28px 1fr; } .para .src { border-right: 0; border-bottom: 1px dashed var(--line); grid-column: 2; } .para .tgt { grid-column: 2; }
  .para .notes-inline { grid-column: 1 / 3; }
}
