/* Novira Translate, T1: opening workspace (upload + configuration).
   Scoped to the opening screen only. The tokens are re-pointed while it is visible
   (body:has), so the processing screen and the editor keep their own look. */
body:has(#uploadSection:not(.hidden)) {
  --bg: #101010; --bg-elevated: #101010; --surface: #171717; --surface-2: #141414;
  --border: #303030; --border-focus: #F3E8D6;
  --accent: #E7D5BA; --accent-hover: #F3E8D6; --accent-soft: #BAA991; --accent-dim: rgba(231,213,186,.12); --accent-ink: #171717;
  --text: #F2F2F2; --text-2: #A4A4A4; --text-3: #A4A4A4;
  --t1-ease: cubic-bezier(.2, .8, .2, 1);
  background: #101010;
}

/* Navigation: 64px, one hairline, no raised container. */
body:has(#uploadSection:not(.hidden)) .nt-header {
  background: #101010; backdrop-filter: none; -webkit-backdrop-filter: none;
  border-bottom: 1px solid #303030; padding: 0 40px;
}
body:has(#uploadSection:not(.hidden)) .nt-logo-product { color: #F3E8D6; font-weight: 550; }
.nt-beta { margin-left: 8px; font-family: var(--mono); font-size: .58rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 2px 7px; border-radius: 99px; border: 1px solid #4A4A4A; color: #BAA991; }
body:has(#uploadSection:not(.hidden)) .nt-quota-chip { background: none; border: 0; padding: 0 4px; font-family: var(--font); font-size: 14px; color: #A4A4A4; }
body:has(#uploadSection:not(.hidden)) a.nt-quota-chip:hover { color: #F3E8D6; }
body:has(#uploadSection:not(.hidden)) .nt-quota-dot,
body:has(#uploadSection:not(.hidden)) .nt-quota-dot.warn { width: 8px; height: 8px; background: #BAA991; box-shadow: none; }
/* An empty balance is a hollow dot, not a different hue. */
body:has(#uploadSection:not(.hidden)) .nt-quota-dot.empty { background: transparent; border: 1px solid #A4A4A4; box-shadow: none; }
body:has(#uploadSection:not(.hidden)) .nt-user-pill { background: none; border: 0; padding: 0 0 0 4px; }
body:has(#uploadSection:not(.hidden)) .nt-btn-signin { background: transparent; border-color: #4A4A4A; border-radius: 7px; }
body:has(#uploadSection:not(.hidden)) .nt-btn-signin:hover { background: #141414; border-color: #A4A4A4; }
@media (max-width: 480px) { body:has(#uploadSection:not(.hidden)) .nt-header { padding: 0 20px; } }

/* Layout */
#uploadSection.nt-workspace {
  grid-template-columns: minmax(0, 58fr) minmax(0, 42fr);
  column-gap: 40px; row-gap: 0; align-items: start;
  max-width: 1240px; padding: 56px 40px 48px;
}
.nt-t1-head { grid-column: 1 / -1; margin: 0 0 32px; }
.nt-t1-head h1 { font-size: clamp(30px, 3.2vw, 48px); font-weight: 550; letter-spacing: -.045em; line-height: 1.15; color: #F3E8D6; margin: 0 0 8px; }
.nt-t1-head p { font-size: 15px; line-height: 1.6; color: #A4A4A4; }

/* Source pages */
#uploadSection .nt-drop-col { padding: 0; background: none; border: 0; border-radius: 0; gap: 16px; }
#uploadSection .nt-drop-label { font-size: 16px; font-weight: 550; letter-spacing: 0; text-transform: none; color: #F2F2F2; }
#uploadSection .nt-drop-label #pageCountLabel { font-family: inherit; color: inherit; }
#uploadSection .nt-ghost-btn { font-size: 13px; color: #A4A4A4; border-radius: 7px; transition: color .15s, background .15s; }
#uploadSection .nt-ghost-btn:hover:not(:disabled) { color: #F2F2F2; background: #141414; }
#uploadSection .nt-ghost-btn:disabled { color: #999999; opacity: .55; cursor: not-allowed; }
#uploadSection .nt-ghost-btn:focus-visible,
#uploadSection .up-choose:focus-visible,
#uploadSection .nt-pg-add:focus-visible,
#uploadSection .pro-fanout-pill:focus-visible { outline: 2px solid #F3E8D6; outline-offset: 2px; }

#uploadSection #dropZone {
  flex: none; min-height: 360px; display: flex; flex-direction: column; justify-content: center;
  border: 1px dashed #383838; border-radius: 8px; background: transparent;
  overflow: visible; cursor: pointer;
  transition: border-color .16s, background .18s;
}
#uploadSection #dropZone:hover { border-color: #BAA991; background: transparent; }
#uploadSection #dropZone.active { border-style: solid; border-color: #F3E8D6; background: #141414; }
#uploadSection #uploadPrompt {
  position: static; padding: 40px 24px; gap: 0; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none;
}
#uploadSection .up-icon { color: #BAA991; margin-bottom: 20px; display: block; }
#uploadSection .up-title { font-size: 22px; font-weight: 550; letter-spacing: -.025em; color: #F2F2F2; margin: 0 0 8px; }
#uploadSection .up-sub { font-size: 14px; line-height: 1.6; color: #A4A4A4; margin: 0 0 24px; }
#uploadSection .up-choose {
  pointer-events: auto; height: 44px; padding: 0 22px; border: 0; border-radius: 7px;
  background: #E7D5BA; color: #171717; font: 600 14px var(--font); cursor: pointer; transition: background .15s;
}
#uploadSection .up-choose:hover { background: #F3E8D6; }
#uploadSection .up-formats { display: block; margin: 16px 0 0; font-size: 12px; line-height: 1.6; color: #A4A4A4; }

/* With pages in it, the zone is just the grid; the dashed frame comes back while dragging over it. */
#uploadSection #dropZone.has-pages { min-height: 0; border: 0; display: block; cursor: default; }
#uploadSection #dropZone.has-pages.active { background: #141414; outline: 1px solid #F3E8D6; outline-offset: 8px; }
#uploadSection #pagesPreviewWrap { position: static; padding: 0; overflow: visible; }
#uploadSection #pagesPreview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.nt-pg { margin: 0; min-width: 0; }
.nt-pg-frame {
  position: relative; aspect-ratio: 3 / 4; background: #171717; border: 1px solid #303030; border-radius: 4px; overflow: hidden;
}
.nt-pg-frame img { display: block; width: 100%; height: 100%; object-fit: contain; }
.nt-pg-cap { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; font-size: 12px; line-height: 1.4; color: #A4A4A4; min-width: 0; }
.nt-pg-n { flex: none; font-family: var(--mono); color: #F3E8D6; }
.nt-pg-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-pg-rm {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; padding: 0;
  display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  background: rgba(16,16,16,.92); border: 1px solid #4A4A4A; color: #F2F2F2;
  transition: border-color .15s, background .15s;
}
.nt-pg-rm::after { content: ''; position: absolute; inset: -8px; }
.nt-pg-rm:hover { background: #171717; border-color: #BAA991; }
.nt-pg-rm:focus-visible { outline: 2px solid #F3E8D6; outline-offset: 2px; }
.nt-pg-add {
  width: 100%; aspect-ratio: 3 / 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 1px dashed #383838; border-radius: 4px; background: transparent; color: #BAA991;
  font: 500 13px var(--font); cursor: pointer; transition: border-color .16s, background .16s, color .16s;
}
.nt-pg-add:hover { border-color: #BAA991; background: #141414; color: #F3E8D6; }
.nt-pg.is-new { animation: nt-pg-in 320ms var(--t1-ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes nt-pg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.nt-retain { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.6; color: #A4A4A4; }
.nt-retain svg { width: 14px; height: 14px; flex: none; margin-top: 3px; color: #BAA991; }
#uploadSection .nt-recent { border-top-color: #303030; margin-top: 8px; }

/* Configuration: open editorial column, one divider. */
#uploadSection .nt-config-panel {
  background: none; border: 0; border-left: 1px solid #303030; border-radius: 0;
  padding: 0 0 0 32px; align-self: stretch;
}
#uploadSection .nt-config-section { padding: 0 0 24px; margin: 0 0 24px; border-bottom: 1px solid #303030; }
#uploadSection .nt-config-section:last-of-type { border-bottom: 1px solid #303030; }
.nt-sec-h { display: flex; align-items: baseline; gap: 10px; margin: 0 0 16px; font-size: 16px; font-weight: 550; letter-spacing: 0; color: #F2F2F2; }
.nt-sec-h .nt-opt { font-size: 13px; font-weight: 400; color: #A4A4A4; }
#uploadSection .nt-field-label { font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; color: #A4A4A4; margin-bottom: 6px; }
.nt-help { font-size: 12px; line-height: 1.6; color: #A4A4A4; margin-top: 8px; }
.nt-help .nt-mono { font-family: var(--mono); color: #F2F2F2; }
.nt-help-em { color: #F2F2F2; }

/* Fields: transparent, underlined; the active boundary turns ivory. */
#uploadSection .nt-select,
#uploadSection .nt-dd-btn,
#uploadSection .nt-textarea {
  background-color: transparent; border: 0; border-bottom: 1px solid #4A4A4A; border-radius: 0;
  color: #F2F2F2; font-size: 14px;
}
#uploadSection .nt-select { padding: 10px 28px 10px 0; background-position: right 2px center; }
#uploadSection .nt-dd-btn { height: 40px; padding: 0; }
#uploadSection .nt-dd-btn:hover { border-bottom-color: #A4A4A4; }
#uploadSection .nt-select:focus,
#uploadSection .nt-dd-btn:focus-visible,
#uploadSection .nt-dd.open .nt-dd-btn,
#uploadSection .nt-textarea:focus { border-bottom-color: #F3E8D6; outline: none; }
#uploadSection .nt-textarea { padding: 8px 0; min-height: 76px; line-height: 1.6; resize: vertical; }
#uploadSection .nt-textarea::placeholder { color: #8c8c8c; }
body:has(#uploadSection:not(.hidden)) .nt-dd-pop { background: #171717; border-color: #303030; border-radius: 8px; box-shadow: 0 12px 32px rgba(0,0,0,.5); }
body:has(#uploadSection:not(.hidden)) .nt-dd-opt.active { background: #141414; }
body:has(#uploadSection:not(.hidden)) .nt-dd-opt[aria-selected="true"] { color: #F3E8D6; }

#uploadSection .nt-lang-row { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: end; }
#uploadSection .nt-swap-btn { width: 36px; height: 36px; margin-bottom: 2px; background: none; border: 0; border-radius: 7px; color: #A4A4A4; transition: color .15s, background .15s; }
#uploadSection .nt-swap-btn:hover { background: #141414; color: #F3E8D6; transform: none; }
#uploadSection .nt-swap-btn:focus-visible { outline: 2px solid #F3E8D6; outline-offset: 2px; }

#uploadSection .pro-fanout { margin-top: 16px; padding-top: 0; border-top: 0; }
#uploadSection .pro-fanout-label { font-size: 12px; line-height: 1.6; color: #A4A4A4; margin-bottom: 8px; }
#uploadSection .pro-fanout-pills { gap: 8px; }
#uploadSection .pro-fanout-pill {
  min-height: 32px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px;
  border-radius: 20px; border: 1px solid #414141; background: transparent; color: #A4A4A4;
  font: 500 13px var(--font); transition: background .15s, border-color .15s, color .15s;
}
#uploadSection .pro-fanout-pill:hover { border-color: #BAA991; color: #F2F2F2; background: #141414; }
#uploadSection .pro-fanout-pill.active,
#uploadSection .pro-fanout-pill[aria-pressed="true"] { background: #E7D5BA; border-color: #E7D5BA; color: #171717; }
/* Selected is also marked by a tick, not colour alone. */
#uploadSection .pro-fanout-pill.active::before,
#uploadSection .pro-fanout-pill[aria-pressed="true"]::before {
  content: ''; width: 11px; height: 11px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E") center / contain no-repeat;
}

#uploadSection .pro-sb-bar { margin-bottom: 16px; }
#uploadSection .ctrl-chip { min-height: 32px; padding: 0 14px; border-radius: 20px; border: 1px solid #414141; background: transparent; color: #F2F2F2; font: 500 13px var(--font); white-space: nowrap; }
#uploadSection .ctrl-chip:hover { border-color: #BAA991; background: #141414; color: #F2F2F2; }
#uploadSection .ctrl-chip:focus-visible { outline: 2px solid #F3E8D6; outline-offset: 2px; }
#uploadSection .nt-badge { font-family: var(--mono); font-size: .58rem; font-weight: 700; letter-spacing: .08em; padding: 2px 7px; border-radius: 99px; border: 1px solid #4A4A4A; color: #BAA991; }

/* Credits and the action */
#uploadSection .nt-config-footer { padding: 0; gap: 16px; margin-top: 0; }
#uploadSection .nt-quota-info { display: flex; align-items: center; justify-content: space-between; gap: 16px; text-align: left; font-size: 13px; line-height: 1.4; color: #A4A4A4; }
.nt-balance-main { display: inline-flex; align-items: baseline; gap: 8px; font-size: 13px; color: #A4A4A4; }
.nt-balance-v { font-size: 22px; font-weight: 550; line-height: 1.2; color: #F3E8D6; }
.nt-balance-l { font-size: 13px; line-height: 1.4; color: #A4A4A4; }
#uploadSection .nt-quota-info a { flex: none; font-size: 14px; font-weight: 500; color: #F3E8D6; text-underline-offset: 3px; text-decoration-color: rgba(243,232,214,.4); }
#uploadSection .nt-quota-info a:hover { color: #fff6e8; }
#uploadSection .nt-quota-info a:focus-visible { outline: 2px solid #F3E8D6; outline-offset: 3px; }
#uploadSection #creditStatus { margin-top: 0; }
#uploadSection .nt-cost-row dt { font-size: 13px; color: #A4A4A4; }
#uploadSection .nt-cost-row dd { font-size: 13px; color: #F2F2F2; }
#uploadSection .nt-cost-hint, #uploadSection .nt-cost-note, #uploadSection .nt-cost-warn { font-size: 12px; line-height: 1.6; }
#uploadSection #translateBtn {
  height: 48px; border-radius: 7px; background: #E7D5BA; color: #171717; font-size: 14px; font-weight: 600; opacity: 1;
  transition: background .16s;
}
#uploadSection #translateBtn:hover:not(:disabled) { background: #F3E8D6; transform: none; }
#uploadSection #translateBtn:active:not(:disabled) { transform: none; }
#uploadSection #translateBtn:disabled { background: #252525; color: #999999; opacity: 1; cursor: not-allowed; }
#uploadSection #translateBtn:focus-visible { outline: 2px solid #F3E8D6; outline-offset: 3px; }
.nt-fine { font-size: 12px; line-height: 1.6; color: #A4A4A4; }
#uploadSection .nt-legal-note a { color: #F2F2F2; }

#uploadSection .nt-check { border-color: #4A4A4A; }
#uploadSection .nt-check:checked { background: #E7D5BA; border-color: #E7D5BA; }
#uploadSection .nv-translate-sponsor { padding-left: 0; padding-right: 0; }

/* Entrance, once, on load. Pure CSS: the content is visible if scripts fail. */
@media (prefers-reduced-motion: no-preference) {
  #uploadSection .nt-t1-head { animation: nt-t1-in-6 360ms var(--t1-ease) both; }
  #uploadSection .nt-drop-col { animation: nt-t1-in-8 420ms var(--t1-ease) 60ms both; }
  #uploadSection .nt-config-panel { animation: nt-t1-in-8 420ms var(--t1-ease) 100ms both; }
  @keyframes nt-t1-in-6 { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
  @keyframes nt-t1-in-8 { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  #uploadSection #dropZone, #uploadSection .nt-ghost-btn, .nt-pg-add, .nt-pg-rm, #uploadSection .pro-fanout-pill, #uploadSection #translateBtn { transition: none; }
  .nt-pg.is-new { animation: none; }
}

@media (pointer: coarse) {
  #uploadSection .pro-fanout-pill, #uploadSection .ctrl-chip { min-height: 44px; }
  .nt-pg-rm { width: 36px; height: 36px; }
  #uploadSection .nt-swap-btn { width: 44px; height: 44px; }
}

/* One column below 860px (the language row gets cramped before 800). */
@media (max-width: 860px) {
  #uploadSection.nt-workspace { grid-template-columns: minmax(0, 1fr); padding: 28px 20px 48px; row-gap: 28px; }
  .nt-t1-head { margin-bottom: 0; }
  #uploadSection .nt-config-panel { border-left: 0; padding: 28px 0 0; border-top: 1px solid #303030; }
  #uploadSection #dropZone { min-height: 280px; }
}
@media (max-width: 479px) {
  #uploadSection #pagesPreview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* A phone keeps the header inside its width: drop the Beta pill, tighten the gaps; the narrowest screens also drop the divider. */
@media (max-width: 480px) {
  body:has(#uploadSection:not(.hidden)) .nt-beta { display: none; }
  body:has(#uploadSection:not(.hidden)) .nt-header-right { gap: 8px; margin-left: 8px; }
  body:has(#uploadSection:not(.hidden)) .nt-quota-chip { font-size: 13px; padding: 0; }
}
@media (max-width: 360px) {
  body:has(#uploadSection:not(.hidden)) .nt-logo { gap: 8px; }
  body:has(#uploadSection:not(.hidden)) .nt-logo-divider { display: none; }
  body:has(#uploadSection:not(.hidden)) .nt-logo img { height: 20px; }
  body:has(#uploadSection:not(.hidden)) .nt-logo-product { font-size: .8rem; }
}
