:root {
  --bg: #f4f5f8;
  --surface: #ffffff;
  --surface-subtle: #f8f9fb;
  --surface-hover: #f0f1f5;
  --ink: #181922;
  --ink-soft: #3e4150;
  --muted: #686d7c;
  --muted-light: #7d8290;
  --line: #e1e4ea;
  --line-strong: #c5cad4;
  --accent: #f05a22;
  --accent-hover: #d94814;
  --accent-ink: #9e310d;
  --accent-soft: #fff1eb;
  --on-accent: #26130c;
  --danger: #b82f3e;
  --danger-soft: #fff0f2;
  --warning: #9a5b00;
  --warning-soft: #fff5df;
  --login-forest: #202230;
  --success: #187657;
  --success-soft: #eaf7f1;
  --radius-sm: 7px;
  --radius: 9px;
  --radius-lg: 11px;
  --shadow-sm: 0 1px 2px rgba(24, 25, 34, 0.05);
  --shadow-md: 0 16px 38px rgba(24, 25, 34, 0.14);
  --font: "Be Vietnam Pro", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
summary,
input[type="checkbox"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.screen {
  min-height: 100vh;
}

.muted {
  color: var(--muted);
}

.small {
  margin: 0;
  font-size: 12px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  line-height: 1.2;
  text-transform: uppercase;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  color: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.wordmark-mark {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  padding: 7px;
  border-radius: 9px;
  color: #fff;
  background: var(--accent);
}

.wordmark-mark span {
  display: block;
  border-radius: 1.5px;
  background: currentColor;
}

.small-mark {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
}

/* Login */
.login-shell {
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--surface-subtle);
}

.login-intro {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(36px, 5vw, 72px);
  color: #f8fafc;
  background:
    radial-gradient(circle at 85% 12%, rgba(96, 165, 250, 0.22), transparent 28%),
    radial-gradient(circle at 10% 88%, rgba(37, 99, 235, 0.16), transparent 32%),
    #111827;
}

.login-intro .wordmark-mark {
  color: #111827;
  background: #f8fafc;
}

.login-statement {
  max-width: 620px;
  margin: clamp(64px, 13vh, 150px) 0;
}

.login-intro .eyebrow {
  color: #93a4bd;
}

.login-statement h1 {
  margin: 20px 0 28px;
  font-size: clamp(44px, 5vw, 72px);
  font-weight: 560;
  letter-spacing: -0.055em;
  line-height: 1.02;
}

.login-lead {
  max-width: 500px;
  margin: 0;
  color: #aebbd0;
  font-size: clamp(14px, 1.2vw, 17px);
  line-height: 1.75;
}

.login-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.login-benefits span {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #aebbd0;
  background: rgba(255, 255, 255, 0.04);
  font-size: 10px;
}

.login-panel {
  display: grid;
  width: 100%;
  place-items: center;
}

.login-card {
  display: grid;
  width: min(360px, 100%);
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 14px;
}

.login-heading {
  margin-bottom: 8px;
}

.login-heading h2 {
  margin: 10px 0 7px;
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.login-heading p:last-child {
  margin: 0;
}

.login-mobile-brand {
  display: none;
}

.field-label {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 670;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

input,
select {
  min-height: 44px;
  padding: 10px 12px;
}

textarea {
  min-height: 88px;
  padding: 10px 12px;
  line-height: 1.6;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-light);
}

input:hover:not(:disabled),
select:hover:not(:disabled),
textarea:hover:not(:disabled) {
  border-color: #aeb5c0;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

input:disabled,
select:disabled,
textarea:disabled {
  color: var(--ink-soft);
  border-color: transparent;
  background: var(--surface-subtle);
  -webkit-text-fill-color: var(--ink-soft);
  opacity: 1;
}

button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease,
    box-shadow 140ms ease, opacity 140ms ease;
}

button:focus-visible,
summary:focus-visible,
input[type="checkbox"]:focus-visible,
.queue-item:focus-visible {
  outline: 3px solid rgba(36, 95, 70, 0.24);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

button.primary {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: var(--shadow-sm);
}

button.primary:hover:not(:disabled) {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

button.primary.partner {
  border-color: var(--success);
  background: var(--success);
}

button.primary.partner:hover:not(:disabled) {
  border-color: #10643f;
  background: #10643f;
}

button.secondary {
  color: var(--ink-soft);
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

button.secondary:hover:not(:disabled) {
  color: var(--ink);
  border-color: #aeb5c0;
  background: var(--surface-subtle);
}

button.text-button {
  min-height: 34px;
  padding-inline: 7px;
  color: var(--muted);
  background: transparent;
}

button.text-button:hover:not(:disabled) {
  color: var(--ink);
  background: var(--surface-hover);
}

button.danger-text {
  color: var(--danger);
}

button.danger-text:hover:not(:disabled) {
  color: #9f2f2f;
  background: var(--danger-soft);
}

button.full-width {
  width: 100%;
}

button.discord {
  width: 100%;
  min-height: 46px;
  margin-bottom: 8px;
}

button.discord svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.token-details,
.connection-details {
  border-top: 1px solid var(--line);
}

.token-details summary,
.connection-details summary {
  padding: 15px 0 0;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  list-style: none;
}

.token-details summary::-webkit-details-marker,
.connection-details summary::-webkit-details-marker {
  display: none;
}

.token-details summary::after,
.connection-details summary::after {
  float: right;
  content: "+";
  color: var(--muted);
  font-size: 16px;
  font-weight: 400;
}

.token-details[open] summary::after,
.connection-details[open] summary::after {
  content: "−";
}

.token-fields {
  display: grid;
  gap: 14px;
  padding-top: 16px;
}

.connection-details .field-label {
  padding-top: 16px;
}

.security-note {
  margin: 2px 0 0;
  color: var(--muted-light);
  font-size: 10px;
  line-height: 1.55;
  text-align: center;
}

.notice {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid currentColor;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.error {
  color: var(--danger);
  background: var(--danger-soft);
}

/* Application */
.app-shell {
  min-width: 0;
  background: var(--bg);
}

.topbar {
  display: grid;
  min-height: 64px;
  grid-template-columns: minmax(190px, 1fr) minmax(280px, 520px) minmax(190px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 10px clamp(18px, 3vw, 36px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-copy {
  display: grid;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 13px;
  letter-spacing: -0.01em;
}

.brand-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.topbar-center {
  width: 100%;
}

.search-control {
  display: flex;
  width: 100%;
  height: 40px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.search-control:focus-within {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-control svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.search-control input {
  min-height: 0;
  flex: 1;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
}

.search-control input:focus {
  box-shadow: none;
}

kbd {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  background: var(--surface);
  font-family: var(--font);
  font-size: 9px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.logout-button svg {
  display: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-button {
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-color: var(--line);
  background: var(--surface);
}

.icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-button.loading svg {
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.user-chip {
  max-width: 180px;
  overflow: hidden;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface-subtle);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-head {
  display: flex;
  min-height: 104px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 24px clamp(18px, 3vw, 36px) 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-subtle);
}

.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-row h1 {
  margin: 0;
  font-size: clamp(26px, 2.5vw, 34px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.badge {
  display: inline-grid;
  min-width: 26px;
  height: 24px;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 10px;
  font-weight: 750;
}

.workspace-summary {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.filter-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.filter-tab {
  min-height: 32px;
  padding: 6px 11px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
}

.filter-tab:hover:not(:disabled) {
  color: var(--ink-soft);
  background: var(--surface-hover);
}

.filter-tab.active {
  color: var(--ink);
  background: var(--surface-hover);
  box-shadow: inset 0 0 0 1px rgba(207, 212, 220, 0.8);
}

.banner {
  position: fixed;
  z-index: 80;
  right: 24px;
  bottom: 24px;
  display: grid;
  width: min(400px, calc(100% - 32px));
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink-soft);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  animation: toast-enter 220ms cubic-bezier(.16, 1, .3, 1);
}

.banner::before {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.banner.error {
  border-color: #efc4c4;
  color: var(--danger);
  background: var(--danger-soft);
}

.banner.error::before {
  background: var(--danger);
}

.banner.ok {
  border-color: #b9ddca;
  color: var(--success);
  background: var(--success-soft);
}

.banner.ok::before {
  background: var(--success);
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toolbar {
  display: none;
  min-height: 52px;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 8px clamp(18px, 3vw, 36px);
  border-bottom: 1px solid #bfd2fb;
  background: var(--accent-soft);
}

.toolbar.has-selection {
  display: flex;
}

.selection-tools,
.toolbar-actions,
.decision-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}

input[type="checkbox"] {
  width: 15px;
  min-height: 15px;
  margin: 0;
  accent-color: var(--accent);
}

.selection-count {
  margin-right: auto;
  color: var(--accent-hover);
  font-size: 11px;
  font-weight: 700;
}

.layout {
  display: grid;
  min-height: calc(100vh - 168px);
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 1px;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.queue-pane {
  min-width: 0;
  border-right: 0;
  background: #eef2f6;
}

.pane-heading {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: #e8edf3;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pane-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.pane-heading .muted {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.select-all-control {
  flex: 0 0 auto;
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
}

.queue-list {
  margin: 0;
  padding: 10px;
  list-style: none;
}

.queue-item {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  margin-bottom: 8px;
  padding: 14px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.queue-item:hover {
  border-color: var(--line-strong);
  background: #fbfcfe;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
}

.queue-item.active {
  border-color: #7fa5f8;
  background: #edf4ff;
  box-shadow: inset 4px 0 0 var(--accent), 0 3px 10px rgba(37, 99, 235, 0.10);
}

.queue-item input[type="checkbox"] {
  margin-top: 2px;
}

.q-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 630;
  letter-spacing: -0.01em;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.q-sub {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.pri,
.stage {
  display: inline-flex;
  align-items: center;
  padding: 3px 6px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 9px;
  font-weight: 750;
  line-height: 1;
  text-transform: uppercase;
}

.stage.pm-decision {
  color: var(--accent-hover);
  background: #dfeaff;
  border-color: #bfd2fb;
}

.stage.zentao-ready {
  color: var(--success);
  background: var(--success-soft);
  border-color: #b7dfcb;
}

.pri {
  color: var(--muted);
  background: #e9ebef;
}

.pri.high,
.pri.highest {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #efc4c4;
}

.pri.medium {
  color: var(--warning);
  background: var(--warning-soft);
  border-color: #ead79d;
}

.empty-state {
  max-width: 250px;
  margin: 72px auto;
  padding: 24px;
  text-align: center;
}

.empty-mark {
  display: inline-grid;
  width: 40px;
  height: 40px;
  margin-bottom: 16px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--success);
  background: var(--surface);
}

.empty-state h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 650;
}

.empty-state p {
  margin: 0;
  font-size: 10px;
}

.detail-pane {
  min-width: 0;
  padding: 0 clamp(22px, 3.5vw, 52px) 64px;
  background: var(--surface-subtle);
}

#detail {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.detail-placeholder {
  display: grid;
  min-height: 100%;
  place-content: center;
  justify-items: center;
  padding: 48px 24px;
  text-align: center;
}

.placeholder-art {
  display: grid;
  width: 72px;
  gap: 7px;
  margin-bottom: 22px;
  padding: 18px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-subtle);
}

.placeholder-art span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--line-strong);
}

.placeholder-art span:nth-child(1) { width: 68%; }
.placeholder-art span:nth-child(2) { width: 100%; }
.placeholder-art span:nth-child(3) { width: 45%; }

.detail-placeholder h2 {
  margin: 10px 0 8px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.detail-placeholder > p:last-child {
  max-width: 370px;
  margin: 0;
  font-size: 11px;
}

.detail-head {
  padding: 32px 2px 24px;
}

.detail-head h2 {
  max-width: 950px;
  margin: 9px 0 14px;
  font-size: clamp(23px, 2.4vw, 34px);
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 10px;
}

.meta-item strong {
  color: var(--ink-soft);
  font-weight: 650;
}

.edit-form {
  display: grid;
  gap: 14px;
}

.form-section,
.asset-section {
  display: grid;
  grid-template-columns: minmax(160px, 0.28fr) minmax(0, 0.72fr);
  gap: clamp(24px, 4vw, 64px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.section-heading > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.section-heading h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.section-heading p {
  max-width: 220px;
  margin: 9px 0 0 24px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.section-index {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-subtle);
  font-family: var(--mono);
  font-size: 9px;
}

.section-status {
  display: inline-flex;
  width: fit-content;
  margin: 14px 0 0 30px;
  padding: 5px 8px;
  border: 1px solid #b9cdf8;
  border-radius: 999px;
  color: #1d4ed8;
  background: #edf4ff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.translation-section {
  border-color: #9db9f5;
  background: linear-gradient(145deg, #ffffff 0%, #f4f7ff 100%);
  box-shadow: 0 3px 14px rgba(37, 99, 235, 0.08);
}

.translation-section .section-index {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.translation-section input,
.translation-section textarea {
  border-color: #b9c8e4;
  background: #fff;
}

/* The ZenTao stage is Chinese-only; Vietnamese source remains available in
   the earlier PM review stage but is never rendered beside this editor. */
.edit-form.translation-mode .source-vi-section {
  display: none !important;
}

.source-vi-section[hidden] {
  display: none !important;
}

.section-heading-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 6px;
}

.field-hint {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
}

.grid-2 {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 13px;
}

.grid-2 .full {
  grid-column: 1 / -1;
}

.stack-fields {
  display: grid;
  min-width: 0;
  gap: 16px;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.edit-form.translation-mode .form-actions {
  position: sticky;
  bottom: 10px;
  z-index: 4;
  border-color: #b9c8e4;
  box-shadow: 0 10px 30px rgba(27, 43, 75, 0.16);
}

.edit-form.is-busy {
  cursor: wait;
  opacity: 0.78;
}

.save-state {
  margin-right: auto;
  color: var(--muted);
  font-size: 10px;
}

.save-state.dirty {
  color: var(--warning);
}

.save-state.dirty::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.save-button {
  min-width: 116px;
}

.partner-preview {
  margin-top: 14px;
  padding: 24px;
  border: 1px solid #8fc9aa;
  border-radius: var(--radius-lg);
  background: #f4fbf7;
}

.preview-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.preview-heading h3 {
  margin: 6px 0 0;
  font-size: 18px;
  font-weight: 650;
}

.preview-status {
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
}

.partner-preview pre {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-family: var(--font);
  font-size: 11px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.asset-section {
  grid-template-columns: minmax(160px, 0.28fr) minmax(0, 0.72fr);
  margin-top: 14px;
}

.attachments {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.attachments > p {
  margin: 0;
  font-size: 10px;
}

.attachments figure {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
}

.attachments img,
.attachments video {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: #eef0f3;
}

.attachments figcaption {
  overflow: hidden;
  padding: 9px 10px;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-log {
  max-height: 220px;
  margin: 26px 0 0;
  overflow: auto;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  background: var(--surface-subtle);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Change Control — approved triage-first composition */
.login-intro {
  background: #15241d;
}

.login-intro .wordmark-mark {
  color: #15241d;
}

.login-context,
.detail-label {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.login-intro .login-context {
  color: #9aada2;
}

.login-benefits {
  gap: 0;
}

.login-benefits span {
  padding: 0 14px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0;
  background: transparent;
}

.login-benefits span:first-child {
  padding-left: 0;
}

.login-benefits span:last-child {
  border-right: 0;
}

.app-shell {
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

.topbar {
  min-height: 56px;
  grid-template-columns: minmax(190px, 1fr) minmax(320px, 560px) minmax(190px, 1fr);
  gap: 20px;
  padding: 8px 20px;
  border-bottom-color: var(--line-strong);
}

.brand-copy strong {
  font-size: 14px;
}

.brand-copy span {
  color: var(--muted);
  letter-spacing: 0.04em;
}

.wordmark-mark {
  border-radius: 3px;
  background: var(--accent);
}

.search-control {
  height: 36px;
  border-radius: 3px;
  background: #fafbfa;
}

.search-control:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(36, 95, 70, 0.12);
}

.user-chip {
  border-radius: 3px;
  background: transparent;
}

.workspace-head {
  min-height: 76px;
  align-items: center;
  padding: 12px 20px;
  background: var(--surface);
}

.title-row h1 {
  font-size: 22px;
  font-weight: 680;
  letter-spacing: -0.025em;
}

.badge {
  min-width: 24px;
  height: 22px;
  border: 1px solid #b9cdc1;
  border-radius: 3px;
}

.workspace-summary {
  margin-top: 4px;
  font-size: 10px;
}

.filter-tabs {
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
}

.filter-tab {
  min-height: 34px;
  padding-inline: 14px;
  border-bottom: 2px solid transparent;
  border-radius: 0;
}

.filter-tab:hover:not(:disabled) {
  background: transparent;
}

.filter-tab.active {
  color: var(--accent-hover);
  border-bottom-color: var(--accent);
  background: transparent;
  box-shadow: none;
}

.layout {
  height: calc(100vh - 132px);
  min-height: 0;
  grid-template-columns: minmax(320px, 34fr) minmax(640px, 66fr);
  gap: 0;
  border-bottom: 0;
  background: var(--surface);
}

.queue-pane {
  display: grid;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  border-right: 1px solid var(--line-strong);
  background: var(--surface);
}

.pane-heading {
  min-height: 42px;
  padding: 0 14px;
  background: var(--surface-subtle);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
}

.pane-heading .muted {
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.toolbar {
  display: none;
  min-height: 48px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-bottom-color: #aac2b4;
  background: #e8f0eb;
}

.toolbar.has-selection {
  display: grid;
  animation: selection-reveal 180ms cubic-bezier(.16, 1, .3, 1);
}

@keyframes selection-reveal {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0); }
}

.toolbar-actions {
  justify-content: flex-end;
  gap: 4px;
}

.toolbar-actions button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 10px;
}

.selection-count {
  color: var(--accent-hover);
  white-space: nowrap;
}

.queue-list {
  min-height: 0;
  margin: 0;
  overflow-y: auto;
  padding: 0;
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

.queue-item {
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  margin: 0;
  padding: 11px 13px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
  transition: background 130ms ease, box-shadow 130ms ease;
}

.queue-item:hover {
  border-color: var(--line);
  background: #f7f9f7;
  box-shadow: none;
}

.queue-item.active {
  border-color: var(--line);
  background: #edf3ef;
  box-shadow: inset 1px 0 0 var(--accent), inset 4px 0 0 #d3e3da;
}

.q-title {
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

.q-sub {
  gap: 6px;
  margin-top: 6px;
  font-size: 9px;
}

.pri,
.stage {
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 8px;
  letter-spacing: 0.02em;
  text-transform: none;
}

.stage.pm-decision {
  color: var(--accent-hover);
  border-color: #b8ccbf;
  background: #eef4f0;
}

.detail-pane {
  min-height: 0;
  overflow-y: auto;
  padding: 0 24px 70px;
  background: var(--surface);
  scrollbar-color: var(--line-strong) transparent;
  scrollbar-width: thin;
}

#detail {
  width: 100%;
  max-width: 1180px;
}

.detail-head {
  position: sticky;
  z-index: 3;
  top: 0;
  padding: 15px 0 13px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface);
}

.detail-label {
  color: var(--accent);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.detail-head h2 {
  max-width: 75ch;
  margin: 5px 0 9px;
  font-size: clamp(19px, 1.6vw, 25px);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.detail-meta {
  gap: 0;
}

.meta-item {
  padding: 2px 9px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  font-size: 9px;
}

.meta-item:first-child {
  padding-left: 0;
}

.meta-item.status,
.meta-item.priority,
.meta-item.severity,
.meta-item.jira {
  margin: 0 3px;
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: 3px;
}

.meta-item.status,
.meta-item.jira {
  color: var(--accent-hover);
  border-color: #bfd2c7;
  background: #edf5f0;
}

.meta-item.priority {
  color: var(--warning);
  border-color: #e5cf9f;
  background: var(--warning-soft);
}

.meta-item.severity {
  color: var(--danger);
  border-color: #ebc7c5;
  background: var(--danger-soft);
}

.edit-form {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 12px;
  padding-top: 14px;
}

.form-section,
.asset-section {
  grid-template-columns: minmax(145px, 0.25fr) minmax(0, 0.75fr);
  gap: clamp(24px, 3vw, 44px);
  padding: 24px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}

.edit-form > .form-section {
  display: block;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.edit-form > .form-section:nth-of-type(1) {
  border-color: #c8d9cf;
  background: #f6faf8;
}

.edit-form > .form-section:nth-of-type(2) {
  border-color: #cbd6e1;
  background: #f7f9fc;
}

.edit-form > .form-section:nth-of-type(3) {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(145px, 0.2fr) minmax(0, 0.8fr);
  gap: 28px;
  border-color: #e1d3b7;
  background: #fffcf6;
}

.edit-form > .translation-section,
.edit-form > .form-actions {
  grid-column: 1 / -1;
}

.edit-form > .form-section .section-heading {
  margin-bottom: 16px;
}

.edit-form > .form-section:nth-of-type(3) .section-heading {
  margin-bottom: 0;
}

.edit-form > .form-section .section-heading h3::before {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--accent);
  content: "";
}

.edit-form > .form-section:nth-of-type(2) .section-heading h3::before {
  background: #4f7596;
}

.edit-form > .form-section:nth-of-type(3) .section-heading h3::before {
  background: #b27723;
}

.section-heading > div {
  display: block;
}

.section-heading h3 {
  font-size: 14px;
  font-weight: 690;
}

.section-heading p {
  margin: 7px 0 0;
  font-size: 10px;
  line-height: 1.55;
}

.section-index {
  display: none;
}

.field-label {
  gap: 6px;
  color: var(--ink-soft);
  font-size: 10px;
}

input,
select {
  min-height: 38px;
  padding: 8px 10px;
}

textarea {
  padding: 9px 10px;
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(36, 95, 70, 0.12);
}

.translation-section {
  border-color: var(--line);
  background: #f7faf8;
  box-shadow: none;
}

.translation-section input,
.translation-section textarea {
  border-color: var(--line-strong);
}

.section-status,
.preview-status {
  border-radius: 3px;
}

.form-actions {
  position: sticky;
  z-index: 5;
  bottom: 0;
  gap: 8px;
  margin: 0 -24px;
  padding: 12px 24px;
  border: 0;
  border-top: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--surface);
  box-shadow: 0 -8px 20px rgba(23, 32, 27, 0.07);
}

.edit-form.translation-mode .form-actions {
  bottom: 0;
  border-color: var(--line-strong);
  box-shadow: 0 -8px 20px rgba(23, 32, 27, 0.07);
}

.partner-preview {
  margin-top: 20px;
  padding: 22px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
}

.asset-section {
  margin-top: 0;
}

.attachments figure,
.action-log {
  border-radius: 3px;
  box-shadow: none;
}

.placeholder-art {
  border-radius: 3px;
  background: var(--surface);
}

@media (max-width: 1060px) {
  .topbar {
    grid-template-columns: auto minmax(240px, 1fr) auto;
  }

  .user-chip {
    display: none;
  }

  .layout {
    grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  }

  .form-section,
  .asset-section {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .section-heading p {
    max-width: none;
  }

  .form-actions {
    flex-wrap: wrap;
  }

  .save-state {
    width: 100%;
  }
}

@media (max-width: 780px) {
  .app-shell {
    height: auto;
    overflow: visible;
  }

  .login-shell {
    display: grid;
  }

  .login-intro {
    display: none;
  }

  .login-panel {
    min-height: 100vh;
    padding: 42px 24px;
    background: var(--bg);
  }

  .login-card {
    padding: 22px;
    box-shadow: none;
  }

  .login-mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 38px;
    font-size: 13px;
  }

  .topbar {
    min-height: 60px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    padding: 10px 14px 12px;
  }

  .brand-copy {
    display: grid;
  }

  .topbar-center {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .topbar-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .search-control kbd {
    display: none;
  }

  .logout-button {
    width: 36px;
    min-height: 36px;
    padding: 0;
    border: 1px solid var(--line);
    background: var(--surface);
  }

  .logout-button svg {
    display: block;
  }

  .logout-button span {
    display: none;
  }

  .workspace-head {
    min-height: 0;
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
    padding: 20px 16px 16px;
  }

  .filter-tabs {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .toolbar {
    display: none;
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
  }

  .toolbar.has-selection {
    display: block;
  }

  .selection-count {
    display: block;
    margin: 0 0 8px;
  }

  .toolbar-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toolbar-actions button {
    width: 100%;
    white-space: normal;
  }

  .layout {
    display: block;
    height: auto;
    min-height: 0;
  }

  .queue-pane {
    display: block;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .pane-heading {
    min-height: 48px;
    padding: 0 16px;
  }

  .queue-list {
    display: grid;
    overflow-y: hidden;
    overflow-x: auto;
    grid-auto-columns: min(82vw, 340px);
    grid-auto-flow: column;
    gap: 10px;
    padding: 12px 16px 16px;
    scroll-padding-inline: 16px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
  }

  .queue-item {
    min-height: 112px;
    align-content: start;
    margin: 0;
    scroll-snap-align: start;
  }

  .queue-item.active {
    box-shadow: inset 0 -4px 0 var(--accent), 0 3px 10px rgba(37, 99, 235, 0.10);
  }

  .empty-state {
    margin: 32px auto;
  }

  .detail-pane {
    min-height: 52vh;
    overflow: visible;
    padding: 0 16px 36px;
  }

  .detail-head {
    padding-top: 26px;
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .edit-form {
    display: block;
    padding-top: 12px;
  }

  .edit-form > .form-section {
    margin-bottom: 12px;
  }

  .edit-form > .form-section:nth-of-type(3) {
    display: block;
  }

  .edit-form > .form-section:nth-of-type(3) .section-heading {
    margin-bottom: 16px;
  }

  .grid-2 .full {
    grid-column: auto;
  }

  .form-section,
  .asset-section {
    gap: 20px;
    padding: 20px;
  }

  .form-actions {
    position: static;
    align-items: stretch;
    flex-direction: column;
    margin: 0;
    padding: 16px;
  }

  .save-state {
    width: auto;
  }

  .decision-actions {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr 1fr;
  }

  .decision-actions button,
  .save-button {
    width: 100%;
    min-width: 0;
  }

  .attachments {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  input,
  select,
  textarea,
  button {
    font-size: 16px;
  }

  button,
  input,
  select {
    min-height: 44px;
  }

  .filter-tab,
  .check,
  .field-label,
  .toolbar-actions button,
  .decision-actions button,
  .save-button {
    font-size: 12px;
  }
}

/* Keep the queue and dossier on one visual baseline on desktop. */
@media (min-width: 781px) {
  .queue-pane:not(:has(.toolbar.has-selection)) .pane-heading {
    height: 58px;
    min-height: 58px;
    align-items: center;
  }
}

/* Impeccable color semantics: VNG orange for action, explicit urgency scales. */
.wordmark-mark,
.small-mark {
  box-shadow: 0 1px 2px rgba(158, 49, 13, 0.2);
}

.search-control:focus-within,
input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(240, 90, 34, 0.18);
}

.workspace-head .badge,
.stage.pm-decision,
.meta-item.status,
.meta-item.jira {
  color: var(--accent-ink);
  border-color: #ffcdbb;
  background: var(--accent-soft);
}

.workspace-head .filter-tab.active,
.selection-count {
  color: var(--accent-ink);
}

.workspace-head .filter-tab.active {
  box-shadow: 0 1px 3px rgba(158, 49, 13, 0.1);
}

.toolbar {
  border-bottom-color: #ffc8b4;
  background: var(--accent-soft);
}

.queue-item.active {
  background: var(--accent-soft);
  box-shadow: inset 1px 0 0 var(--accent);
}

button.primary,
button.primary.partner {
  color: var(--on-accent);
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 1px 2px rgba(158, 49, 13, 0.22);
}

button.primary:hover:not(:disabled),
button.primary.partner:hover:not(:disabled) {
  color: #fff;
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

button.secondary:hover:not(:disabled) {
  color: var(--accent-ink);
  border-color: #efaa8f;
  background: #fff8f5;
}

button:focus-visible,
summary:focus-visible,
input[type="checkbox"]:focus-visible,
.queue-item:focus-visible {
  outline-color: rgba(240, 90, 34, 0.32);
}

.edit-form > .form-section .section-heading h3::before,
.edit-form > .form-section:nth-of-type(2) .section-heading h3::before,
.edit-form > .form-section:nth-of-type(3) .section-heading h3::before,
.asset-section .section-heading h3::before {
  background: var(--accent);
}

/* Priority: business urgency. */
.pri.highest,
.meta-item.priority.highest,
input[name="priority"][data-level="highest"] {
  color: #951d2a;
  border-color: #efb4ba;
  background: #ffeaed;
}

.pri.high,
.meta-item.priority.high,
input[name="priority"][data-level="high"] {
  color: #ae2937;
  border-color: #f1bec3;
  background: #fff0f2;
}

.pri.medium,
.meta-item.priority.medium,
input[name="priority"][data-level="medium"] {
  color: #925400;
  border-color: #edcf91;
  background: #fff5df;
}

.pri.low,
.meta-item.priority.low,
input[name="priority"][data-level="low"] {
  color: #176649;
  border-color: #b7dfcf;
  background: #eaf7f1;
}

/* Severity: technical impact, deliberately distinct from priority. */
.meta-item.severity.critical,
input[name="severity"][data-level="critical"] {
  color: #871d50;
  border-color: #e7b7cf;
  background: #fcecf4;
}

.meta-item.severity.major,
input[name="severity"][data-level="major"] {
  color: #5f3aa7;
  border-color: #d4c4f2;
  background: #f2edfc;
}

.meta-item.severity.minor,
input[name="severity"][data-level="minor"] {
  color: #365c82;
  border-color: #bfd2e4;
  background: #edf4fa;
}

.pri.neutral,
.meta-item.priority.neutral,
.meta-item.severity.neutral,
input[name="priority"][data-level="neutral"],
input[name="severity"][data-level="neutral"] {
  color: var(--muted);
  border-color: var(--line-strong);
  background: var(--surface-subtle);
}

input[name="priority"][data-level],
input[name="severity"][data-level] {
  font-weight: 600;
}

@media (max-width: 440px) {
  .login-card {
    padding: 20px;
  }

  .topbar-center {
    min-width: 0;
  }

  .search-control input {
    min-width: 0;
  }

  .icon-button {
    display: none;
  }

  .filter-tab {
    min-width: 0;
    padding-inline: 6px;
    white-space: normal;
  }

  .toolbar-actions,
  .decision-actions,
  .attachments {
    grid-template-columns: 1fr;
  }

  .form-section,
  .asset-section,
  .partner-preview {
    padding: 18px;
  }

  .section-heading p,
  .section-status {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Impeccable polish: quiet dossier surfaces and in-flow decisions. */
.edit-form > .form-section:nth-of-type(1),
.edit-form > .form-section:nth-of-type(2),
.edit-form > .form-section:nth-of-type(3) {
  border-color: var(--line);
  border-top-color: var(--section-accent, var(--accent));
  background: var(--surface);
}

.edit-form > .form-section:nth-of-type(1) {
  --section-accent: var(--accent);
}

.edit-form > .form-section:nth-of-type(2) {
  --section-accent: #4f7596;
}

.edit-form > .form-section:nth-of-type(3) {
  --section-accent: var(--warning);
}

.test-server-config {
  display: grid;
}

.test-server-config[hidden] {
  display: none;
}

.form-actions,
.edit-form.translation-mode .form-actions {
  position: static;
  z-index: auto;
  bottom: auto;
  grid-column: 1 / -1;
  gap: 8px;
  margin: 0;
  padding: 2px 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.edit-form > .form-actions {
  order: -1;
}

.edit-form.translation-mode .form-actions {
  order: 0;
}

@media (max-width: 760px) {
  .form-actions,
  .edit-form.translation-mode .form-actions {
    align-items: stretch;
    margin: 0 0 12px;
    padding: 0 0 14px;
  }
}

/* Impeccable layout pass: keep the PM dossier inside the desktop viewport. */
@media (min-width: 781px) {
  .layout {
    grid-template-columns: minmax(260px, 28fr) minmax(720px, 72fr);
  }

  .detail-pane {
    padding: 0 18px 40px;
  }

  #detail {
    max-width: none;
  }

  .detail-head {
    padding: 11px 0 10px;
  }

  .detail-head h2 {
    margin: 3px 0 6px;
    font-size: clamp(19px, 1.45vw, 23px);
  }

  .edit-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding-top: 10px;
  }

  .edit-form > .form-section {
    padding: 13px 14px;
  }

  .edit-form > .form-section .section-heading {
    margin-bottom: 10px;
  }

  .edit-form > .form-section:nth-of-type(3) {
    grid-template-columns: minmax(120px, 0.16fr) minmax(0, 0.84fr);
    gap: 18px;
  }

  .edit-form > .form-section:nth-of-type(3) .section-heading {
    margin-bottom: 0;
  }

  .section-heading h3 {
    font-size: 13px;
  }

  .section-heading p {
    margin-top: 4px;
    line-height: 1.4;
  }

  .grid-2,
  .stack-fields {
    gap: 9px 10px;
  }

  .edit-form > .form-section:nth-of-type(2) > .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-label {
    gap: 4px;
  }

  input,
  select {
    min-height: 34px;
    padding-block: 6px;
  }

  textarea {
    padding-block: 7px;
  }

  textarea[name="steps"] {
    height: 72px;
    min-height: 72px;
  }

  textarea[name="expected"],
  textarea[name="actual"] {
    height: 62px;
    min-height: 62px;
  }

  .form-actions,
  .edit-form.translation-mode .form-actions {
    padding-bottom: 9px;
  }

  .asset-section {
    padding-top: 18px;
  }
}

/* Impeccable bolder pass: one decisive evergreen command band. */
.workspace-head {
  border-bottom: 1px solid var(--accent);
  background: var(--login-forest);
}

.title-row h1 {
  color: var(--surface);
  font-weight: 720;
}

.workspace-head .badge {
  color: var(--accent-hover);
  border-color: var(--accent-soft);
  background: var(--accent-soft);
  font-weight: 600;
}

.workspace-head .filter-tab {
  color: #b9cdc1;
  border-bottom-color: transparent;
}

.workspace-head .filter-tabs {
  background: transparent;
}

.workspace-head .filter-tab:hover:not(:disabled) {
  color: var(--surface);
}

.workspace-head .filter-tab.active {
  color: var(--surface);
  border-bottom-color: var(--accent-soft);
}

.layout,
.detail-pane {
  background: var(--surface-subtle);
}

.detail-head {
  background: var(--surface-subtle);
}

.detail-head h2 {
  font-weight: 720;
  letter-spacing: -0.03em;
}

.edit-form > .form-section {
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.edit-form > .form-section:nth-of-type(1),
.edit-form > .form-section:nth-of-type(2) {
  --section-accent: var(--accent);
}

.edit-form > .form-section:nth-of-type(2) .section-heading h3::before {
  background: var(--accent);
}

.source-vi-section .section-heading p {
  display: none;
}

.edit-form > .form-section .section-heading h3 {
  font-size: 14px;
  font-weight: 720;
  letter-spacing: -0.015em;
}

.edit-form > .form-section:nth-of-type(1),
.edit-form > .form-section:nth-of-type(2) {
  min-height: 100%;
}

.form-actions,
.edit-form.translation-mode .form-actions {
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.queue-item.active {
  background: var(--accent-soft);
  box-shadow: inset 1px 0 0 var(--accent), inset 4px 0 0 #b9cdc1;
}

input:not([type="checkbox"]):not([type="hidden"]),
select,
textarea {
  background: var(--surface);
}

input:not([type="checkbox"]):not([type="hidden"]):hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}

.test-server-config {
  min-width: 0;
}

.edit-form > .form-section:nth-of-type(3) {
  display: block;
  grid-template-columns: none;
}

.edit-form > .form-section:nth-of-type(3) .section-heading {
  margin-bottom: 10px;
}

.asset-section {
  display: block;
  margin-top: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-top-color: var(--accent);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.asset-section .section-heading {
  margin-bottom: 10px;
}

.asset-section .section-heading h3 {
  font-size: 14px;
  font-weight: 720;
  letter-spacing: -0.015em;
}

.asset-section .section-heading h3::before {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--accent);
  content: "";
}

.attachments {
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 10px;
}

.attachments figure {
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
}

.attachments img,
.attachments video {
  height: clamp(150px, 16vw, 220px);
}

/* Impeccable color pass: brand, evidence, and semantic states stay distinct. */
.layout,
.detail-pane,
.detail-head {
  background: var(--bg);
}

.edit-form > .form-section:nth-of-type(3) {
  --section-accent: var(--ink-soft);
}

.edit-form > .form-section:nth-of-type(3) .section-heading h3::before {
  background: var(--ink-soft);
}

.asset-section {
  border-top-color: var(--ink-soft);
}

.asset-section .section-heading h3::before {
  background: var(--ink-soft);
}

.toolbar {
  border-bottom-color: var(--accent);
  background: var(--accent-soft);
}

.queue-item.active {
  background: var(--accent-soft);
  box-shadow: inset 1px 0 0 var(--accent), inset 4px 0 0 var(--line-strong);
}

@media (max-width: 780px) {
  .workspace-head {
    gap: 12px;
  }

  .workspace-head .filter-tabs {
    border-top: 1px solid rgba(230, 240, 234, 0.18);
  }

  .asset-section {
    margin-top: 12px;
    padding: 18px;
  }
}

@media (min-width: 781px) and (max-width: 1060px) {
  .layout {
    grid-template-columns: minmax(260px, 30fr) minmax(0, 70fr);
  }

  .edit-form > .form-section:nth-of-type(2) > .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Impeccable modernization: cool workbench, signal-indigo interaction. */
body {
  letter-spacing: 0;
}

.wordmark-mark,
.small-mark {
  border-radius: 9px;
  background: var(--accent);
  box-shadow: 0 1px 2px rgba(69, 70, 191, 0.18);
}

.topbar {
  border-bottom-color: var(--line);
  background: rgba(255, 255, 255, 0.98);
}

.brand-copy strong {
  color: var(--ink);
  font-weight: 650;
}

.brand-copy span {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.025em;
  text-transform: none;
}

.search-control {
  border-color: transparent;
  border-radius: var(--radius);
  background: #f2f3f7;
}

.search-control:hover {
  border-color: var(--line);
  background: var(--surface-subtle);
}

.search-control:focus-within {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(85, 86, 217, 0.14);
}

kbd,
.icon-button,
.user-chip {
  border-color: var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.workspace-head {
  border-bottom-color: var(--line);
  background: var(--surface);
}

.title-row h1 {
  color: var(--ink);
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.workspace-head .badge {
  color: var(--accent-hover);
  border-color: #d9d9ff;
  border-radius: 7px;
  background: var(--accent-soft);
}

.workspace-head .filter-tabs {
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f5f6f9;
}

.workspace-head .filter-tab {
  min-height: 32px;
  padding-inline: 12px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 550;
}

.workspace-head .filter-tab:hover:not(:disabled) {
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.72);
}

.workspace-head .filter-tab.active {
  color: var(--accent-hover);
  border: 0;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(24, 25, 34, 0.08);
}

.layout,
.detail-pane,
.detail-head {
  background: var(--bg);
}

.queue-pane {
  border-right-color: var(--line);
  background: #f8f9fc;
}

.pane-heading {
  border-bottom-color: var(--line);
  background: #f5f6fa;
  font-size: 11px;
  font-weight: 600;
}

.pane-title {
  color: var(--ink-soft);
}

.toolbar {
  border-bottom-color: #d8d9ff;
  background: var(--accent-soft);
}

.selection-count {
  color: var(--accent-hover);
  font-size: 11px;
  font-weight: 600;
}

.queue-item {
  border-bottom-color: var(--line);
  background: transparent;
}

.queue-item:hover {
  background: #f1f2f7;
}

.queue-item.active {
  background: var(--accent-soft);
  box-shadow: inset 1px 0 0 var(--accent);
}

.q-title {
  color: #20212b;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.45;
}

.q-sub {
  font-size: 10px;
}

.pri,
.stage {
  font-size: 9px;
  font-weight: 600;
}

.stage.pm-decision,
.meta-item.status,
.meta-item.jira {
  color: var(--accent-hover);
  border-color: #d8d9ff;
  background: var(--accent-soft);
}

.stage.zentao-ready {
  color: var(--success);
  border-color: #bfe4d5;
  background: var(--success-soft);
}

.pri,
.meta-item,
.stage,
.section-status,
.preview-status {
  border-radius: 6px;
}

.detail-head {
  border-bottom-color: var(--line);
}

.detail-head h2 {
  color: var(--ink);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.meta-item {
  color: var(--muted);
  font-size: 10px;
  font-weight: 450;
}

.meta-item strong {
  font-weight: 600;
}

.edit-form > .form-section,
.asset-section,
.form-actions,
.edit-form.translation-mode .form-actions {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(24, 25, 34, 0.025);
}

.edit-form > .form-section:nth-of-type(1),
.edit-form > .form-section:nth-of-type(2),
.edit-form > .form-section:nth-of-type(3),
.translation-section {
  border-color: var(--line);
  border-top-color: var(--line);
  background: var(--surface);
}

.edit-form > .form-section .section-heading h3,
.asset-section .section-heading h3 {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.edit-form > .form-section .section-heading h3::before,
.asset-section .section-heading h3::before {
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--accent);
}

.edit-form > .form-section:nth-of-type(2) .section-heading h3::before,
.edit-form > .form-section:nth-of-type(3) .section-heading h3::before {
  background: var(--accent);
}

.field-label {
  color: #484b59;
  font-size: 11px;
  font-weight: 550;
}

input:not([type="checkbox"]):not([type="hidden"]),
select,
textarea {
  border-color: #d4d8e1;
  border-radius: var(--radius-sm);
  background: #fbfbfd;
  font-size: 13px;
  font-weight: 400;
}

input:not([type="checkbox"]):not([type="hidden"]):hover,
select:hover,
textarea:hover {
  border-color: #aeb4c1;
  background: var(--surface);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(85, 86, 217, 0.14);
}

button {
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 550;
}

button.primary,
button.primary.partner {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 1px 2px rgba(69, 70, 191, 0.22);
}

button.primary:hover:not(:disabled),
button.primary.partner:hover:not(:disabled) {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

button.secondary {
  color: var(--ink-soft);
  border-color: #cfd3dc;
  background: var(--surface);
}

button.secondary:hover:not(:disabled) {
  color: var(--accent-hover);
  border-color: #b8b9ea;
  background: #f7f7ff;
}

button:focus-visible,
summary:focus-visible,
input[type="checkbox"]:focus-visible,
.queue-item:focus-visible {
  outline-color: rgba(85, 86, 217, 0.28);
}

.form-actions,
.edit-form.translation-mode .form-actions {
  padding: 8px;
  border-color: var(--line);
}

.asset-section {
  border-top-color: var(--line);
}

.attachments figure {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f8fb;
}

.login-shell {
  background: var(--bg);
}

.login-card {
  border-color: var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(24, 25, 34, 0.08);
}

@media (max-width: 780px) {
  .workspace-head {
    background: var(--surface);
  }

  .workspace-head .filter-tabs {
    border-top: 1px solid var(--line);
  }

  input:not([type="checkbox"]):not([type="hidden"]),
  select,
  textarea,
  button {
    font-size: 16px;
  }

  .q-title {
    font-size: 13px;
  }

  .q-sub,
  .pri,
  .stage,
  .meta-item {
    font-size: 10px;
  }
}

/* Final palette authority: keep later component refinements on the VNG scale. */
.wordmark-mark,
.small-mark {
  box-shadow: 0 1px 2px rgba(158, 49, 13, 0.2);
}

.search-control:focus-within,
input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(240, 90, 34, 0.18);
}

.workspace-head .badge,
.stage.pm-decision,
.meta-item.status,
.meta-item.jira {
  color: var(--accent-ink);
  border-color: #ffcdbb;
  background: var(--accent-soft);
}

.workspace-head .filter-tab.active,
.selection-count {
  color: var(--accent-ink);
}

.toolbar {
  border-bottom-color: #ffc8b4;
}

button.primary,
button.primary.partner {
  color: #fff;
  border-color: #c94716;
  background: #c94716;
  box-shadow: 0 1px 2px rgba(125, 39, 10, 0.24);
}

button.primary:hover:not(:disabled),
button.primary.partner:hover:not(:disabled) {
  color: #fff;
  border-color: #b83a0e;
  background: #b83a0e;
}

button.secondary:hover:not(:disabled) {
  color: var(--accent-ink);
  border-color: #efaa8f;
  background: #fff8f5;
}

button:focus-visible,
summary:focus-visible,
input[type="checkbox"]:focus-visible,
.queue-item:focus-visible {
  outline-color: rgba(240, 90, 34, 0.32);
}

@media (max-width: 780px) {
  .banner {
    right: 16px;
    bottom: 16px;
  }
}

/* Partner editor mirrors the Vietnamese dossier's 2-up + full-width rhythm. */
.edit-form.translation-mode > .translation-section {
  display: block;
  grid-column: 1 / -1;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.translation-section > .section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 10px;
}

.translation-section > .section-heading .section-heading-actions,
.translation-section > .section-heading .section-status {
  margin: 0;
}

.partner-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.translation-group {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(24, 25, 34, 0.025);
}

.translation-group h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.translation-group h4::before {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 2px;
  background: var(--accent);
  content: "";
}

.translation-group .stack-fields {
  gap: 9px;
}

.translation-group .grid-2 {
  gap: 9px 10px;
}

.translation-content {
  grid-column: 1 / -1;
}

.translation-section textarea[name="chinese_environment"] {
  height: 54px;
  min-height: 54px;
}

.translation-section textarea[name="chinese_steps"] {
  height: 72px;
  min-height: 72px;
}

.translation-section textarea[name="chinese_expected"],
.translation-section textarea[name="chinese_actual"] {
  height: 62px;
  min-height: 62px;
}

.edit-form.translation-mode .form-actions {
  grid-column: 1 / -1;
  margin-top: 0;
}

.edit-form.translation-mode .save-button {
  color: var(--ink-soft);
  border-color: var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.edit-form.translation-mode .save-button:hover:not(:disabled) {
  color: var(--accent-ink);
  border-color: #efaa8f;
  background: #fff8f5;
}

.partner-preview {
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.partner-preview .preview-heading {
  margin-bottom: 12px;
}

@media (max-width: 780px) {
  .translation-section > .section-heading {
    align-items: flex-start;
  }

  .partner-form-grid {
    grid-template-columns: 1fr;
  }

  .translation-content {
    grid-column: auto;
  }

  .translation-group {
    padding: 18px;
  }
}

/* Partner preview is on demand so the editor never has to scroll to reach it. */
.partner-preview-dialog {
  width: min(760px, calc(100% - 40px));
  max-height: min(78vh, 760px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 64px rgba(24, 25, 34, 0.2);
}

.partner-preview-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  animation: preview-dialog-enter 180ms cubic-bezier(.16, 1, .3, 1);
}

.partner-preview-dialog::backdrop {
  background: rgba(24, 25, 34, 0.42);
}

.partner-preview-dialog .preview-heading {
  align-items: center;
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.partner-preview-dialog .preview-heading h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.preview-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.partner-preview-dialog .preview-status {
  border: 1px solid #b7dfcf;
  border-radius: 6px;
}

.preview-close {
  width: 32px;
  min-height: 32px;
  padding: 0;
}

.preview-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.partner-preview-dialog pre {
  min-height: 0;
  margin: 0;
  overflow: auto;
  padding: 18px;
  color: var(--ink-soft);
  background: #fbfbfd;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.zentao-preview-sheet {
  min-height: 0;
  overflow: auto;
  background: #f7f8fb;
}

.preview-field-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.zentao-preview-title {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.zentao-preview-title h4 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
}

.zentao-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
}

.zentao-preview-meta > div {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f7f8fa;
}

.zentao-preview-meta dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.zentao-preview-meta dd {
  margin: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zentao-preview-meta > .preview-severity-field,
.zentao-preview-meta > .preview-priority-field {
  box-shadow: none;
}

.preview-severity-field[data-level="1"] {
  border-color: #e7b7cf;
  background: #fcecf4;
}

.preview-severity-field[data-level="1"] dd {
  color: #871d50;
}

.preview-severity-field[data-level="2"] {
  border-color: #d4c4f2;
  background: #f2edfc;
}

.preview-severity-field[data-level="2"] dd {
  color: #5f3aa7;
}

.preview-severity-field[data-level="3"] {
  border-color: #bfd2e4;
  background: #edf4fa;
}

.preview-severity-field[data-level="3"] dd {
  color: #365c82;
}

.preview-priority-field[data-level="1"] {
  border-color: #f1bec3;
  background: #fff0f2;
}

.preview-priority-field[data-level="1"] dd {
  color: #ae2937;
}

.preview-priority-field[data-level="2"] {
  border-color: #edcf91;
  background: #fff5df;
}

.preview-priority-field[data-level="2"] dd {
  color: #925400;
}

.preview-priority-field[data-level="3"] {
  border-color: #b7dfcf;
  background: #eaf7f1;
}

.preview-priority-field[data-level="3"] dd {
  color: #176649;
}

.preview-assignee-field {
  border-color: #d5dbe5 !important;
  background: #f4f6f9 !important;
}

.zentao-preview-description {
  margin: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.zentao-preview-description p {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.zentao-preview-description p:last-child {
  margin-bottom: 0;
}

@keyframes preview-dialog-enter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 780px) {
  .partner-preview-dialog {
    width: calc(100% - 24px);
    max-height: 84vh;
  }

  .partner-preview-dialog pre {
    padding: 16px;
    font-size: 14px;
  }

  .zentao-preview-description {
    margin: 10px;
    padding: 14px;
  }
}
