:root {
  --ink: #102a2c;
  --ink-soft: #526668;
  --ink-faint: #859496;
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-soft: #f7f9f8;
  --line: #e2e9e6;
  --line-strong: #d2ddd9;
  --brand: #087b6d;
  --brand-dark: #075e55;
  --brand-soft: #e5f4f0;
  --brand-softer: #f0f9f7;
  --lime: #d9f86d;
  --blue: #3d73d9;
  --blue-soft: #eaf0fc;
  --orange: #d97a2b;
  --orange-soft: #fff2e6;
  --red: #c24a52;
  --red-soft: #faebed;
  --purple: #7554b7;
  --purple-soft: #f0ebfa;
  --shadow-sm: 0 1px 3px rgba(20, 48, 47, .06);
  --shadow-md: 0 14px 40px rgba(20, 48, 47, .10);
  --radius: 14px;
  --sidebar: 252px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

[hidden] { display: none !important; }
.app-shell { min-height: 100vh; }
.auth-root:empty { display: none; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar);
  flex-direction: column;
  padding: 24px 16px 18px;
  color: #dfe9e6;
  background: #102f30;
  transition: transform .25s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 0 8px;
  margin-bottom: 29px;
}
.brand-content { display: contents; }

.brand-mark {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border-radius: 10px;
  color: #123232;
  background: var(--lime);
  font-family: Manrope, sans-serif;
  font-size: 28px;
  font-weight: 700;
  transform: rotate(-3deg);
}

.brand-mark span { transform: rotate(3deg) translateY(-1px); }
.brand-copy { display: flex; flex-direction: column; line-height: 1; }
.brand-copy strong { color: #fff; font-family: Manrope, sans-serif; font-size: 19px; letter-spacing: -.6px; }
.brand-copy small { margin-top: 5px; color: #9ab5b1; font-size: 9px; font-weight: 700; letter-spacing: 2.2px; }

.main-nav { display: flex; flex: 1; flex-direction: column; overflow-y: auto; }
.nav-label { margin: 0 12px 8px; color: #6f908c; font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; }
.nav-label-spaced { margin-top: 24px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  margin: 2px 0;
  padding: 0 12px;
  border-radius: 9px;
  color: #adc1be;
  font-weight: 500;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item.active { color: #fff; background: rgba(217,248,109,.11); box-shadow: inset 3px 0 0 var(--lime); }
.nav-item [data-icon] { display: grid; width: 18px; place-items: center; }
.nav-item svg { width: 18px; height: 18px; }
.nav-item em { min-width: 22px; margin-left: auto; padding: 2px 6px; border-radius: 12px; color: #b8ceca; background: rgba(255,255,255,.08); font-size: 11px; font-style: normal; text-align: center; }
.nav-item .warning-count { color: #ffd4a8; background: rgba(221,125,43,.17); }

.sidebar-foot { padding: 16px 10px 0; border-top: 1px solid rgba(255,255,255,.08); }
.usage-head { display: flex; align-items: center; justify-content: space-between; color: #b7c9c6; font-size: 11px; }
.usage-head strong { color: #eaf2ef; font-weight: 600; }
.usage-track { height: 5px; margin: 10px 0 8px; overflow: hidden; border-radius: 8px; background: rgba(255,255,255,.1); }
.usage-track span { display: block; height: 100%; border-radius: inherit; background: var(--lime); }
.sidebar-foot small { color: #6f908c; font-size: 10px; }

.sidebar-signout {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 11px 0 0;
  border: 0;
  border-top: 1px solid rgba(255,255,255,.08);
  color: #adc1be;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: color .18s ease;
}
.sidebar-signout:hover { color: #fff; }
.sidebar-signout svg { width: 17px; height: 17px; }

.workspace { min-height: 100vh; margin-left: var(--sidebar); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  height: 68px;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
}
.crumb { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.crumb span, .crumb b { color: var(--ink-faint); font-weight: 400; }
.crumb strong { font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.command-search {
  display: flex;
  width: 202px;
  height: 36px;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink-faint);
  background: var(--surface-soft);
  cursor: pointer;
}
.command-search svg { width: 15px; }
.command-search kbd { margin-left: auto; padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink-faint); background: #fff; font: 10px "Inter", sans-serif; }
.icon-button {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
}
.icon-button:hover { background: var(--surface-soft); }
.icon-button svg { width: 17px; height: 17px; }
.icon-button i { position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border: 1px solid #fff; border-radius: 50%; background: var(--red); }
.menu-toggle { display: none; }
.profile { display: flex; align-items: center; gap: 9px; margin-left: 5px; padding: 0 0 0 12px; border: 0; border-left: 1px solid var(--line); color: inherit; background: transparent; text-align: left; cursor: pointer; }
.avatar { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; color: #fff; background: var(--brand); font-size: 11px; font-weight: 700; }
.profile-copy { display: flex; min-width: 92px; flex-direction: column; }
.profile-copy strong { font-size: 12px; font-weight: 600; }
.profile-copy small { margin-top: 2px; color: var(--ink-faint); font-size: 10px; }
.profile > svg { width: 14px; color: var(--ink-faint); }

#page-root { padding: 30px; outline: none; }
.page { max-width: 1440px; margin: 0 auto; animation: page-in .22s ease; }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.page-head h1 { margin: 0; font: 700 25px/1.25 Manrope, sans-serif; letter-spacing: -.5px; }
.page-head p { margin: 7px 0 0; color: var(--ink-soft); }
.head-actions { display: flex; align-items: center; gap: 9px; }

.button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.button:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.button svg { width: 16px; height: 16px; }
.button.primary { border-color: var(--brand); color: #fff; background: var(--brand); }
.button.primary:hover { background: var(--brand-dark); }
.button.soft { border-color: var(--brand-soft); color: var(--brand-dark); background: var(--brand-soft); }
.button.danger { color: var(--red); }
.button.small { min-height: 31px; padding: 0 10px; border-radius: 7px; font-size: 12px; }
.document-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; white-space: nowrap; }
.resource-actions { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.memory-delete-preview { display: grid; gap: 7px; margin: 0 0 18px; padding: 14px; border: 1px solid var(--border); border-radius: 9px; background: var(--panel-muted); }
.memory-delete-preview span { color: var(--muted); }
.memory-delete-preview p { margin: 0; }
.bulk-delete-summary { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; align-items: center; margin-bottom: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.bulk-delete-summary strong, .bulk-delete-summary span { display: block; }
.bulk-delete-summary span { color: var(--ink-faint); font-size: 11px; }
.bulk-delete-summary .button { grid-column: 2; grid-row: 1 / span 2; }
.button.icon-only { width: 38px; padding: 0; }
.button:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; margin-bottom: 18px; }
.stat-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: 12px; }
.stat-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; color: var(--brand); background: var(--brand-soft); }
.stat-icon.blue { color: var(--blue); background: var(--blue-soft); }
.stat-icon.orange { color: var(--orange); background: var(--orange-soft); }
.stat-icon.purple { color: var(--purple); background: var(--purple-soft); }
.stat-icon svg { width: 17px; }
.stat-value { display: flex; align-items: baseline; gap: 7px; margin: 15px 0 4px; }
.stat-value strong { font: 700 26px Manrope, sans-serif; letter-spacing: -.7px; }
.stat-value span { color: var(--brand); font-size: 11px; font-weight: 600; }
.stat-card > small { color: var(--ink-faint); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(280px,.8fr); gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.panel-head { display: flex; min-height: 59px; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font: 700 15px Manrope, sans-serif; }
.panel-head a, .text-link { color: var(--brand); font-size: 12px; font-weight: 600; cursor: pointer; }
.panel-body { padding: 18px; }
.project-list { display: flex; flex-direction: column; }
.project-row { display: grid; grid-template-columns: minmax(200px,1.55fr) 95px 90px minmax(110px,.8fr) 100px 30px; gap: 14px; align-items: center; min-height: 72px; padding: 10px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.project-row:last-child { border-bottom: 0; }
.project-row:hover { background: var(--surface-soft); }
.project-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.file-icon { display: grid; width: 35px; height: 39px; flex: 0 0 auto; place-items: center; border-radius: 7px; color: var(--blue); background: var(--blue-soft); font-size: 9px; font-weight: 700; }
.file-icon.pdf { color: var(--red); background: var(--red-soft); }
.file-icon.xlsx { color: var(--brand); background: var(--brand-soft); }
.project-copy { min-width: 0; }
.project-copy strong { display: block; overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.project-copy small { display: block; margin-top: 5px; color: var(--ink-faint); }
.language-pair { color: var(--ink-soft); font-size: 12px; }
.language-pair span { margin: 0 4px; color: var(--ink-faint); }
.status { display: inline-flex; width: fit-content; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 12px; color: var(--brand-dark); background: var(--brand-soft); font-size: 10px; font-weight: 700; }
.status::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.status.review { color: var(--orange); background: var(--orange-soft); }
.status.done { color: var(--blue); background: var(--blue-soft); }
.status.draft { color: var(--ink-soft); background: #edf1f0; }
.progress-wrap { min-width: 100px; }
.progress-meta { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--ink-faint); font-size: 10px; }
.progress-meta strong { color: var(--ink-soft); font-weight: 600; }
.progress-bar { height: 5px; overflow: hidden; border-radius: 5px; background: #eaf0ed; }
.progress-bar span { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.deadline { color: var(--ink-soft); font-size: 11px; }
.deadline strong { display: block; margin-bottom: 3px; color: var(--ink); font-size: 12px; }
.more-button { display: grid; width: 28px; height: 28px; place-items: center; border: 0; border-radius: 7px; color: var(--ink-faint); background: transparent; cursor: pointer; }
.more-button:hover { background: var(--line); }

.activity-list { display: flex; flex-direction: column; padding: 2px 18px 8px; }
.activity-item { display: grid; grid-template-columns: 31px 1fr; gap: 11px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 50%; color: var(--brand); background: var(--brand-soft); }
.activity-dot svg { width: 14px; }
.activity-dot.orange { color: var(--orange); background: var(--orange-soft); }
.activity-dot.blue { color: var(--blue); background: var(--blue-soft); }
.activity-copy p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.activity-copy strong { color: var(--ink); font-weight: 600; }
.activity-copy time { display: block; margin-top: 5px; color: var(--ink-faint); font-size: 10px; }

.quick-card { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; margin-top: 18px; padding: 17px 19px; border: 1px solid #c7e5dd; border-radius: var(--radius); background: linear-gradient(110deg, #effaf7, #f8fcfa); }
.quick-card > span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 11px; color: #fff; background: var(--brand); }
.quick-card h3 { margin: 0 0 3px; font: 700 14px Manrope, sans-serif; }
.quick-card p { margin: 0; color: var(--ink-soft); font-size: 12px; }
.processing-banner { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; padding: 14px 18px; border: 1px solid #b9ddd7; border-radius: 14px; background: #edf9f7; color: #145d54; }
.processing-banner > svg { width: 22px; height: 22px; flex: 0 0 auto; }
.processing-banner > div { display: flex; flex: 1; flex-direction: column; gap: 2px; }
.processing-banner > div span { color: #56716d; font-size: 12px; }
.processing-banner > span { font-weight: 800; }
.processing-banner.failed { border-color: #f2c7ae; background: #fff5ed; color: #9a4a18; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 9px; }
.search-field { position: relative; }
.search-field svg { position: absolute; top: 50%; left: 12px; width: 15px; color: var(--ink-faint); transform: translateY(-50%); pointer-events: none; }
.search-field input { width: 270px; height: 38px; padding: 0 12px 0 37px; border: 1px solid var(--line-strong); border-radius: 9px; outline: none; background: var(--surface); }
.search-field input:focus, .form-field input:focus, .form-field select:focus, .form-field textarea:focus, .target-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(8,123,109,.1); }
.select-control { height: 38px; padding: 0 32px 0 11px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--ink-soft); outline: none; background: var(--surface); }

.data-panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.resource-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); color: var(--ink-faint); font-size: 12px; }
.resource-pagination span { min-width: 210px; text-align: center; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 11px 15px; color: var(--ink-faint); background: var(--surface-soft); font-size: 10px; font-weight: 700; letter-spacing: .55px; text-align: left; text-transform: uppercase; }
.data-table td { padding: 13px 15px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 12px; vertical-align: middle; }
.data-table td strong { color: var(--ink); font-weight: 600; }
.data-table tr[data-open-project] { cursor: pointer; }
.data-table tbody tr:hover { background: #fafcfb; }
.client-cell { display: flex; align-items: center; gap: 10px; }
.client-logo { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 8px; color: var(--brand-dark); background: var(--brand-soft); font-size: 10px; font-weight: 700; }
.member-stack { display: flex; }
.member-stack span { display: grid; width: 25px; height: 25px; margin-left: -5px; place-items: center; border: 2px solid #fff; border-radius: 50%; color: #fff; background: var(--brand); font-size: 8px; font-weight: 700; }
.member-stack span:first-child { margin-left: 0; }
.member-stack span:nth-child(2) { background: var(--blue); }
.member-stack span:nth-child(3) { color: var(--ink); background: var(--lime); }

.editor-page { max-width: none; margin: -30px; animation: page-in .22s ease; }
.editor-head { display: flex; min-height: 74px; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 22px; border-bottom: 1px solid var(--line); background: var(--surface); }
.editor-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.back-button { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.editor-title h1 { overflow: hidden; margin: 0 0 3px; font: 700 15px Manrope, sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.editor-title p { margin: 0; color: var(--ink-faint); font-size: 10px; }
.editor-title p span { margin: 0 6px; }
.editor-actions { display: flex; align-items: center; gap: 8px; }
.editor-progress { display: flex; min-width: 185px; flex-direction: column; gap: 5px; margin-right: 5px; }
.editor-progress div { display: flex; justify-content: space-between; color: var(--ink-faint); font-size: 10px; }
.editor-progress strong { color: var(--brand); }
.language-toolbar { display: flex; min-height: 54px; align-items: center; gap: 9px; padding: 8px 22px; border-bottom: 1px solid var(--line); background: #f8fbfa; }
.language-toolbar label { display: flex; align-items: center; gap: 7px; }
.language-toolbar label > span { color: var(--ink-faint); font-size: 9px; font-weight: 700; letter-spacing: .45px; text-transform: uppercase; }
.language-toolbar select { height: 34px; min-width: 165px; padding: 0 29px 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: #fff; outline: none; cursor: pointer; }
.language-toolbar select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(8,123,109,.1); }
.language-swap { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #b9d9d2; border-radius: 8px; color: var(--brand); background: var(--brand-softer); font-size: 18px; cursor: pointer; }
.language-swap:hover { border-color: var(--brand); background: var(--brand-soft); }
.language-toolbar small { margin-left: auto; color: var(--ink-faint); font-size: 10px; }
.editor-shell { display: grid; grid-template-columns: minmax(630px,1fr) 330px; min-height: calc(100vh - 196px); }
.segments-area { min-width: 0; background: #f8faf9; }
.segments-toolbar { display: flex; min-height: 51px; align-items: center; justify-content: space-between; padding: 0 17px; border-bottom: 1px solid var(--line); background: var(--surface); }
.segments-toolbar-left { display: flex; align-items: center; gap: 12px; }
.segments-toolbar strong { font-size: 11px; }
.segments-toolbar span { color: var(--ink-faint); font-size: 10px; }
.segment-filter { display: flex; gap: 3px; padding: 3px; border-radius: 8px; background: var(--surface-soft); }
.segment-filter button { padding: 5px 8px; border: 0; border-radius: 6px; color: var(--ink-faint); background: transparent; font-size: 10px; cursor: pointer; }
.segment-filter button.active { color: var(--ink); background: #fff; box-shadow: var(--shadow-sm); }
.cat-navigation { display: flex; min-height: 45px; align-items: center; justify-content: space-between; gap: 14px; padding: 6px 17px; border-bottom: 1px solid var(--line); background: #fbfcfc; }
.cat-navigation-arrows { display: grid; grid-template-columns: repeat(4,32px); gap: 5px; }
.cat-navigation-arrows button, .target-editor-tools button { display: grid; min-width: 32px; height: 30px; place-items: center; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--ink-soft); background: #fff; font-weight: 700; cursor: pointer; }
.cat-navigation-arrows button:hover, .cat-navigation-arrows button:focus-visible, .target-editor-tools button:hover, .target-editor-tools button:focus-visible { border-color: #9bc9c0; color: var(--brand); background: var(--brand-softer); outline: none; }
.cat-shortcuts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 14px; color: var(--ink-faint); font-size: 9px; }
.cat-shortcuts span { white-space: nowrap; }
.cat-shortcuts kbd { display: inline-block; min-width: 18px; margin: 0 1px; padding: 2px 4px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; color: var(--ink-soft); background: #fff; font: 700 8px "Inter",sans-serif; text-align: center; }
.segment-columns { display: grid; grid-template-columns: 44px minmax(250px,1fr) minmax(250px,1fr) 44px; min-height: 32px; align-items: center; padding: 0 9px; border-bottom: 1px solid var(--line); color: var(--ink-faint); background: #f1f5f3; font-size: 9px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.segment-columns span:nth-child(2), .segment-columns span:nth-child(3) { padding-left: 13px; }
.segments-list { padding-bottom: 30px; }
.react-segments-scroll { height: calc(100vh - 375px); min-height: 340px; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.react-segments-virtual { width: 100%; }
.react-cat-editor .segment-row { contain: layout paint; }
.react-cat-editor .segment-state .state-dot { border: 0; cursor: pointer; }
.react-cat-editor .segment-state .state-dot:focus-visible { outline: 3px solid rgba(8,123,109,.22); outline-offset: 2px; }
.react-cat-editor .editor-actions { flex-wrap: wrap; justify-content: flex-end; }
.react-cat-editor .workflow-alert, .react-cat-editor .workflow-readonly { border-radius: 0; }
.react-segment-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 8px; }
.react-segment-actions span { color: var(--ink-faint); font-size: 9px; }
.segment-row { display: grid; grid-template-columns: 44px minmax(250px,1fr) minmax(250px,1fr) 44px; min-height: 88px; margin: 0 9px; border-bottom: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: box-shadow .15s, transform .15s; }
.segment-row:hover { background: #fcfdfd; }
.segment-row.active { position: relative; z-index: 1; margin-top: 5px; margin-bottom: 5px; border: 1px solid var(--brand); border-radius: 9px; box-shadow: 0 5px 18px rgba(8,123,109,.09); }
.react-cat-editor .segment-row.active { contain: layout; }
.segment-row.virtual-joined { border-left: 3px solid #86bfb4; background: #fbfefd; }
.segment-row.virtual-joined-start { border-top: 1px solid #b9dcd4; border-radius: 7px 7px 0 0; }
.segment-row.virtual-joined-end { border-bottom: 1px solid #b9dcd4; border-radius: 0 0 7px 7px; }
.virtual-join-marker { position: absolute; bottom: -7px; left: 50%; z-index: 3; padding: 1px 7px; transform: translateX(-50%); border-radius: 8px; color: var(--brand-dark); background: #d9eee9; font-size: 8px; font-weight: 700; letter-spacing: .25px; text-transform: uppercase; }
.segment-num { display: flex; align-items: flex-start; justify-content: center; padding-top: 15px; color: var(--ink-faint); font-size: 10px; }
.segment-source, .segment-target { padding: 13px; border-left: 1px solid var(--line); font-size: 13px; line-height: 1.55; }
.segment-source { color: #263c3d; }
.segment-target { position: relative; }
.target-input { width: 100%; min-height: 60px; resize: vertical; border: 1px solid transparent; border-radius: 6px; color: var(--ink); background: transparent; line-height: 1.55; outline: none; }
.target-input::placeholder { color: #aab7b5; }
.segment-row.active .target-input { padding: 8px; border-color: var(--line); background: #fff; }
.segment-row.active .target-editor-tools + .target-input, .segment-row.active .target-editor-tools + .target-field > .target-input { padding-top: 39px; }
.target-editor-tools { position: absolute; top: 18px; right: 19px; z-index: 4; display: flex; align-items: center; gap: 5px; }
.target-editor-tools button { width: auto; height: 25px; min-width: 28px; padding: 0 7px; border-color: var(--line); font-size: 9px; }
.case-control { position: relative; }
.case-menu { position: absolute; top: 29px; right: 0; z-index: 8; display: grid; width: 124px; overflow: hidden; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow-md); }
.case-menu button { display: block; width: 100%; height: 28px; border: 0; background: transparent; font-weight: 600; text-align: left; }
.case-menu button:hover, .case-menu button:focus-visible { border: 0; background: var(--brand-soft); }
.segment-state { display: flex; align-items: flex-start; justify-content: center; padding-top: 16px; border-left: 1px solid var(--line); }
.state-dot { display: grid; width: 21px; height: 21px; place-items: center; border-radius: 50%; color: var(--ink-faint); background: #edf1f0; }
.state-dot svg { width: 12px; }
.state-dot.confirmed { color: #fff; background: var(--brand); }
.state-dot.ai { color: var(--purple); background: var(--purple-soft); }
.state-dot.review { color: var(--orange); background: var(--orange-soft); }
.match-label { display: inline-block; margin-top: 8px; padding: 2px 6px; border-radius: 5px; color: var(--brand); background: var(--brand-soft); font-size: 9px; font-weight: 700; }
.match-label.ai { color: var(--purple); background: var(--purple-soft); }

.suggestions { border-left: 1px solid var(--line); background: var(--surface); }
.suggestions-tabs { display: grid; grid-template-columns: repeat(3,1fr); min-height: 51px; border-bottom: 1px solid var(--line); }
.suggestions-tabs button { position: relative; border: 0; color: var(--ink-faint); background: transparent; font-size: 11px; font-weight: 600; cursor: pointer; }
.suggestions-tabs button.active { color: var(--brand); }
.suggestions-tabs button.active::after { position: absolute; right: 20px; bottom: -1px; left: 20px; height: 2px; background: var(--brand); content: ""; }
.suggestion-content { padding: 17px; }
.suggestion-card { margin-bottom: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.suggestion-card.primary-suggestion { border-color: #b9dcd4; background: var(--brand-softer); }
.suggestion-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.suggestion-card-head strong { font-size: 10px; letter-spacing: .3px; text-transform: uppercase; }
.match-score { padding: 3px 6px; border-radius: 5px; color: var(--brand); background: var(--brand-soft); font-size: 9px; font-weight: 700; }
.suggestion-card p { margin: 0 0 9px; font-size: 12px; line-height: 1.45; }
.suggestion-card .source-mini { padding-bottom: 9px; border-bottom: 1px solid var(--line); color: var(--ink-faint); }
.suggestion-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.term-hit { display: grid; grid-template-columns: 1fr auto 1fr; gap: 9px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.term-hit:last-child { border-bottom: 0; }
.term-hit span:nth-child(2) { color: var(--ink-faint); }
.context-box { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.context-box h4 { margin: 0 0 9px; font-size: 10px; letter-spacing: .4px; text-transform: uppercase; }
.context-box p { margin: 0; color: var(--ink-faint); font-size: 11px; line-height: 1.5; }

.resource-summary { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 17px; }
.mini-stat { padding: 15px 17px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.mini-stat span { display: block; color: var(--ink-faint); font-size: 10px; }
.mini-stat strong { display: block; margin-top: 5px; font: 700 19px Manrope, sans-serif; }

.qa-layout { display: grid; grid-template-columns: 250px 1fr; gap: 17px; }
.qa-score { padding: 22px; text-align: center; }
.score-ring { position: relative; display: grid; width: 118px; height: 118px; margin: 4px auto 17px; place-items: center; border-radius: 50%; background: conic-gradient(var(--brand) 0 94%, #e7eeeb 94%); }
.score-ring::before { position: absolute; width: 88px; height: 88px; border-radius: 50%; background: #fff; content: ""; }
.score-ring strong { position: relative; font: 700 25px Manrope, sans-serif; }
.qa-score h3 { margin: 0; font: 700 15px Manrope, sans-serif; }
.qa-score p { margin: 6px 0 18px; color: var(--ink-faint); font-size: 11px; }
.qa-legend { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.qa-legend div { display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: 11px; }
.qa-legend span { display: flex; align-items: center; gap: 7px; }
.qa-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.qa-legend i.warn { background: var(--orange); }
.qa-legend i.ok { background: var(--brand); }
.issue-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 8px 17px; border-bottom: 1px solid var(--line); }
.issue-row:last-child { border-bottom: 0; }
.issue-open { display: grid; grid-template-columns: 34px minmax(0,1fr) 130px; gap: 12px; align-items: center; min-width: 0; padding: 6px 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.issue-open:hover .issue-copy strong, .issue-open:focus-visible .issue-copy strong { color: var(--brand); }
.issue-open:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 7px; }
.issue-actions { display: flex; gap: 7px; justify-content: flex-end; }
.qa-accept { color: var(--brand-deep); border-color: var(--brand-soft); background: var(--brand-pale); }
.issue-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 8px; color: var(--orange); background: var(--orange-soft); }
.issue-icon.error { color: var(--red); background: var(--red-soft); }
.issue-icon svg { width: 15px; }
.issue-copy strong { display: block; font-size: 12px; }
.issue-copy small { display: block; margin-top: 4px; color: var(--ink-faint); }
.issue-location { color: var(--ink-faint); font-size: 11px; }

.team-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
.member-card { position: relative; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.member-card-head { display: flex; align-items: center; gap: 12px; }
.avatar.large { width: 43px; height: 43px; font-size: 12px; }
.member-card h3 { margin: 0 0 4px; font: 700 14px Manrope, sans-serif; }
.member-card p { margin: 0; color: var(--ink-faint); font-size: 11px; }
.online { position: absolute; top: 23px; right: 20px; width: 8px; height: 8px; border: 2px solid #fff; border-radius: 50%; background: var(--brand); }
.member-meta { display: flex; justify-content: space-between; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-faint); font-size: 10px; }
.member-meta strong { color: var(--ink-soft); }
.member-role-control { margin-top: 15px; }
.member-role-select { width: 100%; height: 36px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: #fff; }
.member-suspended { opacity: .66; }
.member-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px 12px; margin-top: 11px; }
.member-status { color: var(--red); }
.member-delete { margin-left: auto; color: var(--red); text-decoration: underline; text-underline-offset: 2px; }
.role-pill { display: inline-flex; width: fit-content; align-items: center; padding: 4px 8px; border-radius: 12px; color: var(--brand-dark); background: var(--brand-soft); font-size: 10px; font-weight: 700; }
.owner-role { color: #5c4700; background: #fff3bd; box-shadow: inset 0 0 0 1px #eed679; }
.permission-note { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 12px 14px; border: 1px solid #c8e2dc; border-radius: 10px; color: var(--ink-soft); background: var(--brand-softer); font-size: 11px; }
.permission-note svg { width: 18px; flex: 0 0 auto; color: var(--brand); }
.permission-note strong { color: var(--ink); }
.invitations-panel { margin-top: 18px; overflow: hidden; }
.invitation-row { display: grid; grid-template-columns: minmax(180px,1fr) 170px 100px auto; gap: 15px; align-items: center; padding: 13px 18px; border-top: 1px solid var(--line); }
.invitation-row strong, .invitation-row small { display: block; }
.invitation-row small, .invitation-row time { margin-top: 3px; color: var(--ink-faint); font-size: 10px; }

.settings-grid { display: grid; grid-template-columns: 210px 1fr; gap: 18px; }
.settings-menu { height: fit-content; padding: 8px; }
.settings-menu button { display: flex; width: 100%; min-height: 38px; align-items: center; gap: 9px; padding: 0 10px; border: 0; border-radius: 7px; color: var(--ink-soft); background: transparent; text-align: left; cursor: pointer; }
.settings-menu button.active { color: var(--brand-dark); background: var(--brand-soft); font-weight: 600; }
.settings-menu button:disabled { opacity: .48; cursor: not-allowed; }
.settings-menu svg { width: 15px; }
.settings-content { padding: 21px; }
.settings-content h2 { margin: 0 0 5px; font: 700 17px Manrope, sans-serif; }
.settings-content > p { margin: 0 0 22px; color: var(--ink-faint); }
.provider-card { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); }
.provider-icon { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 9px; color: var(--brand); background: var(--brand-soft); font-size: 11px; font-weight: 700; }
.provider-card h3 { margin: 0 0 3px; font-size: 13px; }
.provider-card p { margin: 0; color: var(--ink-faint); font-size: 10px; }
.connection-state { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 11px; font-weight: 600; }
.connection-state::before { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); content: ""; }
.connection-state.connected { color: var(--brand); }
.connection-state.connected::before { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.connection-state.disconnected { color: var(--red); }
.connection-state.disconnected::before { background: var(--red); }
.security-note, .format-note { display: flex; align-items: flex-start; gap: 9px; padding: 11px 12px; border: 1px solid #c8e2dc; border-radius: 9px; color: var(--ink-soft); background: var(--brand-softer); font-size: 11px; line-height: 1.5; }
.security-note svg, .format-note svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--brand); }
.security-note code { padding: 1px 4px; border-radius: 4px; color: var(--ink); background: var(--brand-soft); }
.assignment-list { display: flex; flex-direction: column; gap: 9px; margin-bottom: 16px; }
.assignment-row { display: grid; grid-template-columns: 18px minmax(0,1fr) 150px; gap: 12px; align-items: center; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.assignment-row strong, .assignment-row small { display: block; }
.assignment-row small { margin-top: 3px; color: var(--ink-faint); font-size: 10px; }
.assignment-row select { min-height: 36px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px; padding: 0; border: 0; color: var(--brand); background: none; font: 600 11px Inter,sans-serif; cursor: pointer; }
.back-link svg { width: 14px; height: 14px; }
.project-workflow-summary { display: grid; grid-template-columns: repeat(3,minmax(110px,170px)) minmax(260px,1fr); gap: 12px; align-items: center; margin-bottom: 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.project-workflow-summary div { display: flex; flex-direction: column; gap: 4px; }
.project-workflow-summary span { color: var(--ink-faint); font-size: 10px; }
.project-workflow-summary strong { font: 700 18px Manrope,sans-serif; }
.project-workflow-summary p { display: flex; align-items: center; gap: 8px; margin: 0; padding-left: 16px; border-left: 1px solid var(--line); color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.project-workflow-summary p svg { flex: 0 0 auto; width: 17px; color: var(--brand); }
.review-note { display: block; max-width: 220px; margin-top: 5px; color: #9a5b12; }
.workflow-alert, .workflow-readonly { display: flex; align-items: center; gap: 7px; min-height: 36px; padding: 8px 22px; border-bottom: 1px solid #efd4ac; color: #7b4a0d; background: #fff6e8; font-size: 11px; }
.workflow-alert svg { width: 15px; }
.workflow-readonly { justify-content: center; border-color: var(--line); color: var(--ink-soft); background: var(--surface-soft); }
.target-input[readonly] { color: var(--ink-soft); background: #f5f8f7; cursor: default; }
.role-guide { margin: 18px 0; }
.role-guide .panel-head p { margin: 4px 0 0; color: var(--ink-faint); font-size: 10px; }
.role-guide-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 0; }
.role-guide-grid div { min-height: 76px; padding: 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.role-guide-grid div:nth-child(3n) { border-right: 0; }
.role-guide-grid div:nth-last-child(-n+3) { border-bottom: 0; }
.role-guide-grid strong, .role-guide-grid span { display: block; }
.role-guide-grid strong { margin-bottom: 5px; font-size: 11px; }
.role-guide-grid span { color: var(--ink-faint); font-size: 10px; line-height: 1.45; }
.form-help { margin: 0; color: var(--ink-faint); font-size: 11px; }
.switch { position: relative; width: 39px; height: 22px; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 20px; background: #ccd6d3; cursor: pointer; transition: .2s; }
.switch span::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); content: ""; transition: .2s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(17px); }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; padding: 20px; place-items: center; background: rgba(9,30,30,.52); backdrop-filter: blur(3px); animation: fade .18s ease; }
.auth-backdrop { position: fixed; inset: 0; z-index: 300; display: grid; padding: 22px; place-items: center; background: radial-gradient(circle at 20% 20%, #1d665d 0, #0b3331 42%, #071f20 100%); }
.auth-card { width: min(430px,100%); padding: 34px; border: 1px solid rgba(255,255,255,.15); border-radius: 18px; background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.35); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-brand > div { display: flex; flex-direction: column; }
.auth-brand strong { font: 700 16px Manrope,sans-serif; }
.auth-brand small { color: var(--brand); font-size: 8px; font-weight: 800; letter-spacing: 2px; }
.auth-card h1 { margin: 0; font: 700 24px Manrope,sans-serif; }
.auth-card > p { margin: 8px 0 24px; color: var(--ink-faint); line-height: 1.55; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 600; }
.auth-form input { height: 42px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 8px; outline: none; }
.password-input { position: relative; display: block; width: 100%; }
.password-input input { width: 100%; padding-right: 43px; }
.password-input button { position: absolute; top: 50%; right: 7px; display: grid; width: 32px; height: 32px; padding: 0; place-items: center; transform: translateY(-50%); border: 0; border-radius: 7px; color: var(--ink-faint); background: transparent; cursor: pointer; }
.password-input button:hover, .password-input button:focus-visible { color: var(--brand); background: var(--brand-soft); outline: none; }
.auth-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(8,123,109,.1); }
.auth-form .button { min-height: 42px; margin-top: 4px; }
.auth-help { margin: 0; color: var(--ink-faint); font-size: 10px; line-height: 1.5; text-align: center; }
.text-button { padding: 4px; border: 0; color: var(--brand); background: transparent; font-size: 11px; font-weight: 600; cursor: pointer; }
.auth-message { padding: 10px 12px; border-radius: 8px; color: #8a4e09; background: var(--orange-soft); font-size: 11px; line-height: 1.45; white-space: pre-line; }
.auth-loading { text-align: center; }
.auth-loading .auth-brand { text-align: left; }
.auth-loading .spinner { width: 28px; height: 28px; margin: 2px auto 18px; }
.auth-loading h1 { font-size: 20px; }
.auth-loading p { margin-bottom: 0; }
.auth-startup { background: #0b3331; }
.startup-brand { display: flex; flex-direction: column; align-items: center; opacity: .96; animation: startup-in .18s ease; }
.startup-brand .auth-brand { margin: 0 0 20px; color: #fff; }
.startup-brand .auth-brand strong { color: #fff; }
.startup-brand .spinner { width: 22px; height: 22px; border-color: rgba(217,248,109,.22); border-top-color: var(--lime); }
@keyframes startup-in { from { opacity: 0; } }
.workspace-error { max-width: 560px; margin: 7vh auto 0; }
.workspace-error > svg { color: var(--orange); }
.workspace-error h2 { margin: 8px 0; color: var(--ink); font: 700 18px Manrope,sans-serif; }
.workspace-error p { margin: 0 auto 18px; line-height: 1.55; }
.account-summary { display: flex; flex-direction: column; gap: 5px; margin-bottom: 18px; padding: 14px; border-radius: 10px; background: var(--surface-soft); }
.account-summary > span:not(.role-pill) { color: var(--ink-faint); font-size: 11px; }
.modal-foot .button.danger { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px,100%); max-height: calc(100vh - 40px); overflow-y: auto; border-radius: 16px; background: var(--surface); box-shadow: 0 25px 80px rgba(0,0,0,.25); animation: modal-in .2s ease; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.99); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 21px 22px 17px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font: 700 18px Manrope, sans-serif; }
.modal-head p { margin: 5px 0 0; color: var(--ink-faint); font-size: 11px; }
.modal-close { display: grid; width: 31px; height: 31px; place-items: center; border: 0; border-radius: 7px; background: var(--surface-soft); cursor: pointer; }
.modal-body { padding: 21px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 22px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-field { display: flex; flex-direction: column; gap: 7px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { color: var(--ink-soft); font-size: 11px; font-weight: 600; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 39px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; outline: none; background: #fff; }
.form-field input[type="file"] { padding: 7px; cursor: pointer; }
.form-field input[type="file"]::file-selector-button { margin-right: 10px; padding: 7px 10px; border: 0; border-radius: 6px; color: var(--brand-dark); background: var(--brand-soft); font-weight: 600; cursor: pointer; }
.form-field textarea { min-height: 75px; resize: vertical; }
.danger-zone { margin-bottom: 16px; padding: 13px 14px; border: 1px solid #efc6c6; border-radius: 9px; color: #8d3038; background: var(--red-soft); line-height: 1.5; }
.danger-zone p { margin: 0; }
.drop-zone { display: grid; min-height: 125px; place-items: center; padding: 20px; border: 1.5px dashed #a9c7c0; border-radius: 11px; background: var(--brand-softer); text-align: center; cursor: pointer; }
.drop-zone input { display: none; }
.drop-zone svg { width: 25px; height: 25px; margin-bottom: 7px; color: var(--brand); }
.drop-zone strong { display: block; font-size: 12px; }
.drop-zone small { display: block; margin-top: 4px; color: var(--ink-faint); }

.search-overlay { position: fixed; inset: 0; z-index: 110; display: flex; justify-content: center; padding-top: 11vh; background: rgba(9,30,30,.48); backdrop-filter: blur(3px); }
.search-dialog { width: min(590px,calc(100% - 28px)); height: fit-content; overflow: hidden; border-radius: 14px; background: #fff; box-shadow: 0 25px 70px rgba(0,0,0,.25); }
.search-dialog-input { display: flex; align-items: center; gap: 10px; padding: 15px; border-bottom: 1px solid var(--line); }
.search-dialog-input svg { width: 19px; color: var(--ink-faint); }
.search-dialog-input input { flex: 1; border: 0; outline: none; font-size: 15px; }
.search-results { padding: 8px; }
.search-result { display: flex; width: 100%; align-items: center; gap: 12px; padding: 11px; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; }
.search-result:hover { background: var(--surface-soft); }
.search-result > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 7px; color: var(--brand); background: var(--brand-soft); }
.search-result p { margin: 0; font-size: 12px; font-weight: 600; }
.search-result small { display: block; margin-top: 2px; color: var(--ink-faint); }
.search-hint { padding: 10px 15px; border-top: 1px solid var(--line); color: var(--ink-faint); background: var(--surface-soft); font-size: 10px; }

.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; min-width: 280px; max-width: 380px; align-items: center; gap: 10px; padding: 13px 15px; border: 1px solid #c6e0d9; border-radius: 10px; color: var(--ink); background: #fff; box-shadow: var(--shadow-md); text-align: left; pointer-events: auto; cursor: pointer; animation: toast-in .25s ease; }
.project-row-button { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; }
.workspace-error { display: flex; max-width: 1440px; align-items: center; gap: 12px; margin: 0 auto 18px; padding: 12px 14px; border: 1px solid #edc6c8; border-radius: 10px; color: #8d3038; background: var(--red-soft); }
.workspace-error span { flex: 1; }
.toast svg { width: 17px; color: var(--brand); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.busy-overlay { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; padding: 20px; background: rgba(9,30,30,.46); backdrop-filter: blur(3px); }
.busy-dialog { display: grid; min-width: 280px; place-items: center; padding: 24px; border-radius: 14px; background: #fff; box-shadow: var(--shadow-md); text-align: center; }
.busy-dialog strong { margin-top: 13px; font: 700 14px Manrope, sans-serif; }
.busy-dialog small { margin-top: 5px; color: var(--ink-faint); }
.spinner { width: 29px; height: 29px; border: 3px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { padding: 55px 20px; color: var(--ink-faint); text-align: center; }
.empty-state svg { width: 28px; margin-bottom: 7px; }
.hidden { display: none !important; }

@media (max-width: 1120px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .editor-shell { grid-template-columns: 1fr; }
  .suggestions { display: none; }
  .project-row { grid-template-columns: minmax(200px,1.5fr) 90px 90px minmax(100px,.8fr) 30px; }
  .project-row .deadline { display: none; }
  .team-grid { grid-template-columns: repeat(2,1fr); }
  .project-workflow-summary { grid-template-columns: repeat(3,1fr); }
  .project-workflow-summary p { grid-column: 1/-1; padding: 12px 0 0; border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-md); }
  body.menu-open .sidebar { transform: translateX(0); }
  .workspace { margin-left: 0; }
  .menu-toggle { display: grid; }
  .crumb { display: none; }
  .topbar { padding: 0 17px; }
  #page-root { padding: 21px 17px; }
  .editor-page { margin: -21px -17px; }
  .profile-copy, .profile > svg, .command-search span, .command-search kbd { display: none; }
  .command-search { width: 36px; justify-content: center; padding: 0; }
  .profile { padding-left: 8px; }
  .qa-layout, .settings-grid { grid-template-columns: 1fr; }
  .settings-menu { display: flex; overflow-x: auto; }
  .settings-menu button { width: auto; white-space: nowrap; }
  .editor-progress { display: none; }
  .language-toolbar { flex-wrap: wrap; padding-right: 17px; padding-left: 17px; }
  .language-toolbar small { width: 100%; margin-left: 0; }
  .cat-shortcuts { display: none; }
  .cat-navigation { justify-content: flex-start; }
  .invitation-row { grid-template-columns: minmax(180px,1fr) auto; }
  .invitation-row time { display: none; }
}

@media (max-width: 620px) {
  .page-head { flex-direction: column; }
  .head-actions, .head-actions .button { width: 100%; }
  .stats-grid, .resource-summary, .team-grid { grid-template-columns: 1fr; }
  .role-guide-grid, .project-workflow-summary { grid-template-columns: 1fr; }
  .role-guide-grid div, .role-guide-grid div:nth-child(3n), .role-guide-grid div:nth-last-child(-n+3) { border-right: 0; border-bottom: 1px solid var(--line); }
  .role-guide-grid div:last-child { border-bottom: 0; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .search-field, .search-field input { width: 100%; }
  .data-panel { overflow-x: auto; }
  .data-table { min-width: 720px; }
  .project-row { grid-template-columns: 1fr 82px; }
  .project-row > *:not(.project-info):not(.status) { display: none; }
  .quick-card { grid-template-columns: 42px 1fr; }
  .quick-card .button { grid-column: 1/-1; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: auto; }
  .editor-head { align-items: flex-start; flex-direction: column; }
  .editor-actions { width: 100%; overflow-x: auto; }
  .language-toolbar label { flex: 1; align-items: flex-start; flex-direction: column; }
  .language-toolbar select { width: 100%; min-width: 0; }
  .language-swap { margin-top: 17px; flex: 0 0 auto; }
  .segment-columns, .segment-row { grid-template-columns: 34px minmax(230px,1fr) 34px; }
  .segment-columns span:nth-child(2)::after { content: " / Destino"; }
  .segment-columns span:nth-child(3) { display: none; }
  .segment-source { display: none; }
  .segment-target { border-left: 1px solid var(--line); }
  .issue-row { grid-template-columns: 1fr; }
  .issue-open { grid-template-columns: 34px 1fr; }
  .issue-location { grid-column: 2; }
  .issue-actions { grid-column: 1; padding-left: 46px; justify-content: flex-start; }
  .invitation-row { grid-template-columns: 1fr; }
  .invitation-row .button { width: 100%; }
}


.subscription-card { margin-bottom: 22px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.subscription-card-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.subscription-card-head span:first-child { color: var(--ink-faint); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.subscription-card-head h2 { margin: 5px 0 3px; font-size: 20px; }
.subscription-card-head p { margin: 0; color: var(--ink-faint); font-size: 11px; }
.subscription-usage-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 9px; margin-top: 16px; }
.subscription-usage-item { padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.subscription-usage-item span { display: block; color: var(--ink-faint); font-size: 9px; }
.subscription-usage-item strong { display: block; margin-top: 7px; font-size: 16px; }
.subscription-usage-item small { display: block; margin-top: 4px; color: var(--ink-faint); font-size: 9px; }
.subscription-card > small { display: block; margin-top: 12px; color: var(--ink-faint); }
@media (max-width: 1120px) { .subscription-usage-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 620px) { .subscription-card-head { flex-direction: column; } .subscription-usage-grid { grid-template-columns: 1fr; } }


.joined-segment-block { min-height: 132px; border: 1px solid #a9d4cb; border-left: 4px solid var(--brand); border-radius: 9px; background: #fbfefd; }
.joined-segment-block.active { border-color: var(--brand); }
.joined-source { display: grid; gap: 0; padding-top: 10px; padding-bottom: 10px; }
.joined-source > div { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: start; padding: 7px 2px; }
.joined-source > div small, .joined-target-part > small { color: var(--ink-faint); font-size: 8px; font-weight: 700; }
.joined-source > div i { position: absolute; right: 2px; bottom: 0; left: 42px; height: 1px; background: var(--line); }
.joined-target { padding-top: 10px; padding-bottom: 10px; }
.joined-target-parts { overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.joined-target-part { display: grid; grid-template-columns: 34px 1fr; gap: 6px; align-items: start; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.joined-target-part:last-child { border-bottom: 0; }
.joined-target-part > small { padding-top: 9px; }
.joined-target-part .target-input { min-height: 48px; padding: 7px; border: 0; background: transparent; }
.joined-target-part .target-input:focus { background: var(--surface-soft); }
.joined-segment-block .target-editor-tools { top: 12px; right: 14px; }
.joined-segment-block.active .joined-target { padding-top: 42px; }


.mt-priority-panel { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.mt-priority-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.mt-priority-head h3 { margin: 0 0 4px; }
.mt-priority-head p { margin: 0; color: var(--ink-muted); font-size: 12px; }
.mt-priority-list { display: grid; gap: 8px; }
.mt-priority-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; opacity: .72; }
.mt-priority-row.active { opacity: 1; border-color: #c9c4ff; }
.mt-priority-rank { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-soft); font-weight: 700; }
.mt-priority-row strong, .mt-priority-row small { display: block; }
.mt-priority-row small { margin-top: 2px; color: var(--ink-muted); font-size: 11px; }
.mt-priority-actions { display: flex; gap: 6px; align-items: center; }


/* Realtime team presence */
.presence-cluster { position: relative; }
.presence-cluster > summary {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.presence-cluster > summary::-webkit-details-marker { display: none; }
.presence-cluster[open] > summary, .presence-cluster > summary:hover { background: var(--surface-soft); }
.presence-label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 11px; white-space: nowrap; }
.presence-label > i, .presence-user small > i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22a06b;
  box-shadow: 0 0 0 2px rgba(34,160,107,.12);
}
.presence-label strong { color: var(--ink); font-size: 11px; }
.presence-avatars { display: flex; align-items: center; padding-left: 4px; }
.presence-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  margin-left: -6px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .02em;
}
.presence-avatars .presence-avatar:first-child { margin-left: 0; }
.presence-avatar.more { color: var(--ink-soft); background: var(--surface-soft); }
.presence-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  width: min(370px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.presence-popover header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}
.presence-popover header > div { display: flex; flex-direction: column; gap: 3px; }
.presence-popover header strong { font-size: 13px; }
.presence-popover header small { color: var(--ink-faint); font-size: 10px; }
.presence-popover header > span {
  display: grid;
  min-width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-size: 11px;
  font-weight: 700;
}
.presence-list { max-height: 360px; overflow-y: auto; padding: 7px; }
.presence-user {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px;
  border-radius: 9px;
}
.presence-user:hover { background: var(--surface-soft); }
.presence-user .presence-avatar { width: 32px; height: 32px; margin: 0; border: 0; font-size: 10px; }
.presence-user > div { min-width: 0; }
.presence-user strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; }
.presence-user small {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.presence-user small > i { flex: 0 0 auto; width: 6px; height: 6px; box-shadow: none; }
.presence-empty { padding: 20px 14px; color: var(--ink-faint); text-align: center; font-size: 11px; }

@media (max-width: 1100px) {
  .presence-label { display: none; }
  .presence-cluster > summary { padding: 0 7px; }
}
@media (max-width: 760px) {
  .presence-cluster { display: none; }
}

.subscription-usage-title{display:flex;align-items:center;justify-content:space-between;gap:8px}
.subscription-usage-title b{font-size:8px;text-transform:uppercase;letter-spacing:.05em}
.subscription-usage-item.warning{border-color:#e3bf63;background:#fffaf0}
.subscription-usage-item.warning .subscription-usage-title b{color:#9a6b00}
.subscription-usage-item.critical{border-color:#dc8a8a;background:#fff6f6}
.subscription-usage-item.critical .subscription-usage-title b{color:#b42318}
.subscription-usage-progress{height:5px;margin-top:9px;overflow:hidden;border-radius:999px;background:#edf1ef}
.subscription-usage-progress i{display:block;height:100%;border-radius:999px;background:var(--brand)}
.subscription-usage-item.warning .subscription-usage-progress i{background:#c58a12}
.subscription-usage-item.critical .subscription-usage-progress i{background:#c43232}

/* Editor CAT: target field mirrors the source height and grows with its text. */
.segment-source-text { display: block; white-space: pre-wrap; overflow-wrap: anywhere; }
.react-cat-editor .target-input { display: block; min-height: 0; padding: 0; resize: none; overflow: hidden; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.react-cat-editor .segment-row.active .target-input { padding: 8px; }
.react-cat-editor .segment-row.active .target-editor-tools + .target-input, .react-cat-editor .segment-row.active .target-editor-tools + .target-field > .target-input { padding-top: 39px; }
.react-cat-editor .joined-target-part .target-input { padding: 7px; }
.segment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.segment-meta:empty { display: none; }
.qa-badge { display: inline-block; margin-top: 8px; padding: 2px 6px; border-radius: 5px; font-size: 9px; font-weight: 700; cursor: help; }
.qa-badge.error { color: #b42318; background: #fde8e7; }
.qa-badge.warning { color: #8a5a00; background: #fff3d6; }
.segment-qa { margin-top: 8px; padding: 8px 10px; border: 1px solid #f3d9a4; border-radius: 7px; background: #fffaf0; font-size: 11px; line-height: 1.45; cursor: default; }
.segment-qa.has-errors { border-color: #f4c2bf; background: #fff6f5; }
.segment-qa ul { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; }
.segment-qa li { display: flex; gap: 6px; }
.segment-qa li b { flex: 0 0 auto; font-weight: 400; }
.segment-qa li.error { color: #9f1d14; }
.segment-qa li.warning { color: #7a5000; }
.tm-diff del { color: #b42318; background: #fde8e7; text-decoration: line-through; }
.tm-diff ins { color: #146c43; background: #e2f5ea; text-decoration: none; }

/* Settings: characters consumed per machine-translation API. */
.mt-usage-panel { margin-top: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.mt-usage-list { display: grid; gap: 8px; }
.mt-usage-row { display: grid; grid-template-columns: minmax(150px, 200px) 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.mt-usage-row.warning { border-color: #f0d08a; }
.mt-usage-row.critical { border-color: #f1aaa5; }
.mt-usage-name strong, .mt-usage-name small { display: block; }
.mt-usage-name small, .mt-usage-figures small { color: var(--ink-muted); font-size: 11px; }
.mt-usage-figures { display: grid; gap: 3px; font-size: 12px; }
.mt-usage-row.warning .subscription-usage-progress i { background: #c58a12; }
.mt-usage-row.critical .subscription-usage-progress i { background: #c43232; }
@media (max-width: 760px) {
  .mt-usage-row { grid-template-columns: 1fr; }
}
/* Rows are positioned by the virtualizer: margins are not measured, so the active row must not use them. */
.react-cat-editor .segment-row.active { margin-top: 0; margin-bottom: 0; }

/* Search highlights in the CAT editor (the search bar itself is in editor-tools.css). */
/* Occurrences in the source text. */
.segment-source-text mark { padding: 0; border-radius: 2px; color: inherit; background: rgba(250, 204, 21, .5); }

/* Occurrences in the translation: a backdrop with the same box and text sits behind the
   textarea; only its marks are visible. */
.target-field { position: relative; }
.target-field > .target-backdrop { position: absolute; inset: 0; z-index: 0; height: auto !important; min-height: 0 !important; margin: 0; overflow: hidden; color: transparent !important; pointer-events: none; resize: none; white-space: pre-wrap; overflow-wrap: anywhere; }
.target-field > .target-backdrop.readonly { background: #f5f8f7; }
.target-field > .target-backdrop mark { padding: 0; border-radius: 2px; color: transparent; background: rgba(250, 204, 21, .55); }
/* Parts of longer words (only without "Palavra inteira" or with *): orange, to stand out. */
.segment-source-text mark.partial { background: rgba(249, 115, 22, .38); box-shadow: inset 0 -2px 0 rgba(234, 88, 12, .85); }
.target-field > .target-backdrop mark.partial { background: rgba(249, 115, 22, .38); box-shadow: inset 0 -2px 0 rgba(234, 88, 12, .85); }
.target-field.has-highlight > textarea.target-input { position: relative; z-index: 1; background: transparent !important; }
