/*
 * Web layout for the online document tools page (webtranslate.html).
 *
 * Web-only: webtranslate.html is the sole page that loads this file, so the
 * plugin-scale sizing in terminology.css (30px buttons, 32px selects, 36px
 * header) is safe to override here without affecting Office sidebar pages.
 * terminology.css and workspace-chrome.css are shared and are not modified.
 *
 * Load order matters: this file must come after terminology.css and
 * doc2excel.css so the web-scale overrides win.
 */

.tc-wt-page {
  --tc-wt-maxw: 1160px;
  --tc-wt-gap: 20px;
  --tc-wt-card-radius: 16px;
  --tc-wt-topbar-h: 60px;
  --tc-wt-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --tc-wt-shadow-md: 0 4px 16px -4px rgba(16, 24, 40, 0.1), 0 2px 6px -2px rgba(16, 24, 40, 0.05);
  --tc-wt-shadow-lg: 0 18px 44px -20px rgba(16, 24, 40, 0.28), 0 4px 12px -6px rgba(16, 24, 40, 0.1);
}

/* terminology.css sets html,body{overflow:hidden} for the fixed-height plugin
   shell; the web page needs to scroll normally. */
html.tc-wt-page,
body.tc-wt-page {
  height: auto;
  min-height: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 14px;
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(0, 120, 212, 0.09), transparent 60%),
    radial-gradient(760px 420px at 100% 0%, rgba(20, 184, 166, 0.08), transparent 58%),
    linear-gradient(180deg, #f7f9fc 0%, #eef2f8 100%);
  background-attachment: fixed;
}

.tc-app.tc-app--webtranslate {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
  max-height: none;
  overflow: visible;
}

/* ---------- top bar ---------- */

/* Overrides the 36px plugin brand bar; the grid columns come from
   workspace-chrome.css (.tc-panel-header) and are kept intact. */
.tc-header--brand.tc-wt-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  flex: 0 0 auto;
  min-height: var(--tc-wt-topbar-h);
  max-height: none;
  height: var(--tc-wt-topbar-h);
  padding: 0 max(16px, env(safe-area-inset-left, 0px)) 0 max(16px, env(safe-area-inset-right, 0px)) !important;
  background: linear-gradient(100deg, #0a6ec4 0%, #0078d4 46%, #1a8fe0 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset, 0 6px 20px -12px rgba(16, 24, 40, 0.5);
}

.tc-wt-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #fff;
}
.tc-wt-brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.16);
}
.tc-wt-brand-name {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.tc-header--brand h1.tc-wt-page-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
}
.tc-wt-page-title-main {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
}
.tc-wt-page-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
}
.tc-wt-page-title-sub {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tc-wt-beta {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.36);
}

.tc-wt-head-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.14);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.tc-wt-head-download:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}
.tc-wt-head-download:active { transform: none; }
.tc-wt-head-download[hidden] { display: none !important; }
.tc-wt-head-download-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* The membership chip is injected into the header by membership-hint.js. */
.tc-mem-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  max-width: min(160px, 40vw);
}
.tc-mem-chip:hover { background: rgba(255, 255, 255, 0.24); }
.tc-mem-chip--low { border-color: #ffd60a; background: rgba(255, 214, 10, 0.2); }
.tc-mem-chip:not(.tc-mem-chip--ready) .tc-mem-cta { display: none; }
.tc-mem-chip--paid .tc-mem-cta { display: none; }
.tc-mem-plan { overflow: hidden; text-overflow: ellipsis; }
.tc-mem-cta { font-weight: 600; padding-left: 2px; color: #ffe566; }

/* ---------- page shell ---------- */

.tc-wt-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--tc-wt-maxw);
  margin: 0 auto;
  padding: 32px max(20px, env(safe-area-inset-left, 0px)) calc(40px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: var(--tc-wt-gap);
}

/* ---------- tabs (base styles live in doc2excel.css) ---------- */

.tc-tabs {
  align-self: center;
  max-width: 100%;
  margin-bottom: 0;
  padding: 5px;
  border-radius: 999px;
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--tc-wt-shadow-md);
}
.tc-tabs .tc-tab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 999px;
}
.tc-tabs .tc-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, #0a6ec4, #1a8fe0);
  box-shadow: 0 4px 12px -4px rgba(0, 120, 212, 0.55);
}

/* ---------- stage: idle (centred form) vs workspace (canvas + right rail) ----------
   Grid areas rather than DOM moves: webtranslate.js resolves all 21 per-panel
   controls by id and switchTab() toggles `hidden` on the tabPanel* wrappers, so
   the markup must stay where it is. Only the layout changes. */

.tc-wt-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "rail";
  gap: var(--tc-wt-gap);
  align-items: start;
}
.tc-wt-rail {
  grid-area: rail;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--tc-wt-gap);
}
.tc-wt-canvas { grid-area: canvas; min-width: 0; }
.tc-wt-canvas[hidden] { display: none; }

.tc-wt-stage[data-mode="idle"] .tc-wt-rail {
  max-width: 680px;
  margin-inline: auto;
  width: 100%;
}

/* Below the two-column breakpoint the canvas stacks ABOVE the form: the
   document is what the user came to look at, and burying it under the whole
   control rail would mean scrolling past everything to reach it. */
@media (max-width: 1099px) {
  .tc-wt-stage[data-mode="workspace"] {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "canvas" "rail";
  }
}

@media (min-width: 1100px) {
  .tc-wt-stage[data-mode="workspace"] {
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-areas: "canvas rail";
  }
  .tc-wt-stage[data-mode="workspace"] .tc-wt-rail {
    position: sticky;
    top: calc(var(--tc-wt-topbar-h) + 20px);
    max-height: calc(100dvh - var(--tc-wt-topbar-h) - 40px);
    overflow-y: auto;
    scrollbar-width: thin;
  }
  /* The canvas owns the viewport height in workspace mode, so the page itself
     must not also scroll or the user gets two scrollbars. */
  body[data-wt-mode="workspace"] { overflow: hidden; }
  body[data-wt-mode="workspace"] .tc-wt-main { max-width: 1520px; }
  body[data-wt-mode="workspace"] .tc-wt-page-footer { display: none; }
}

/* Workspace mode shrinks the form to rail width: the explanatory copy and the
   oversized dropzone art are the first things to go. */
.tc-wt-stage[data-mode="workspace"] .tc-wt-card { padding: 18px 18px 16px; }
.tc-wt-stage[data-mode="workspace"] .tc-wt-lede,
.tc-wt-stage[data-mode="workspace"] .tc-wt-foot:not(.tc-wt-foot--workspace) { display: none; }
.tc-wt-foot--workspace {
  display: none;
  margin-top: 14px;
  padding-top: 12px;
  text-align: left;
  font-size: 12px;
  line-height: 1.55;
}
.tc-wt-stage[data-mode="workspace"] .tc-wt-foot--workspace { display: block; }
.tc-wt-stage[data-mode="workspace"] .tc-wt-drop { padding: 16px 12px; }
.tc-wt-stage[data-mode="workspace"] .tc-wt-drop-icon { display: none; }
.tc-wt-stage[data-mode="workspace"] .tc-d2x-files { display: none; }
.tc-wt-stage[data-mode="workspace"] .tc-wt-card .tc-field { margin-bottom: 14px; }
.tc-wt-stage[data-mode="workspace"] .tc-btn.tc-wt-submit { margin-top: 14px; }
.tc-wt-stage[data-mode="workspace"] .tc-tabs { display: none; }

@keyframes tc-rail-in {
  from { opacity: 0; transform: translateX(26px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes tc-canvas-in {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.tc-wt-stage[data-mode="workspace"] .tc-wt-rail {
  animation: tc-rail-in 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.tc-wt-stage[data-mode="workspace"] .tc-wt-canvas {
  animation: tc-canvas-in 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) 0.06s both;
}

body[data-wt-mode="workspace"] .tc-wt-plans { display: none; }

/* ---------- workspace chrome (back + header title) ---------- */

.tc-wt-back {
  display: none;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 6px 10px 6px 4px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.tc-wt-back-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.tc-wt-back:hover { background: rgba(255, 255, 255, 0.14); }
.tc-wt-back:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.85);
  outline-offset: 1px;
}
body[data-wt-mode="workspace"] .tc-wt-back { display: inline-flex; }
body[data-wt-mode="workspace"] .tc-wt-brand { display: none; }

body[data-wt-mode="workspace"] .tc-wt-page-title {
  flex-direction: column;
  gap: 1px;
}
body[data-wt-mode="workspace"] .tc-wt-beta { display: none; }

.tc-wt-resume-preview {
  padding: 2px 4px 0;
}
.tc-wt-resume-preview-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 11px 14px;
  border: 1px solid rgba(0, 120, 212, 0.22);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.92));
  box-shadow: var(--tc-wt-shadow-sm);
  color: #0a6ec4;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.tc-wt-resume-preview-btn svg {
  display: block;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.88;
}
.tc-wt-resume-preview-btn:hover {
  border-color: rgba(0, 120, 212, 0.38);
  background: #fff;
  box-shadow: var(--tc-wt-shadow-md);
}
.tc-wt-resume-preview-btn:focus-visible {
  outline: 2px solid rgba(0, 120, 212, 0.45);
  outline-offset: 2px;
}

/* ---------- cards ---------- */

.tc-wt-card {
  padding: 28px 28px 24px;
  border-radius: var(--tc-wt-card-radius);
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: var(--tc-surface);
  box-shadow: var(--tc-wt-shadow-lg);
}
.tc-wt-lede {
  margin: 0 0 22px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--tc-muted);
}

/* ---------- header plan link ---------- */

/* Credits are deliberately not surfaced on this page; the balance element is
   kept in the DOM but visually hidden (see webtranslate.html). */
.tc-wt-plan-link {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.tc-wt-plan-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}
.tc-wt-plan-link-label { opacity: 0.7; }
.tc-wt-plan-link-value {
  font-weight: 600;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- form controls (web scale) ---------- */

.tc-wt-card .tc-field { margin-bottom: 22px; }
.tc-wt-card .tc-field:last-of-type { margin-bottom: 0; }

.tc-wt-card .tc-field-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--tc-muted);
  margin-bottom: 8px;
}

select.tc-select.tc-wt-lang {
  height: 46px;
  min-height: 46px;
  padding: 0 14px;
  font-size: 15px;
  border-radius: 10px;
  background: var(--tc-surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
select.tc-select.tc-wt-lang:focus {
  outline: none;
  border-color: var(--tc-accent);
  box-shadow: 0 0 0 3px var(--tc-accent-soft);
}

.tc-wt-card .tc-d2x-prompt {
  min-height: 92px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
}

input[type=file].tc-wt-file-input { display: none; }
.hidden { display: none !important; }

/* ---------- dropzone ---------- */

.tc-wt-drop {
  position: relative;
  border: 1.5px dashed #c3cdda;
  border-radius: 14px;
  padding: 34px 20px;
  text-align: center;
  color: var(--tc-muted);
  cursor: pointer;
  background: linear-gradient(180deg, #fbfcfe 0%, #f6f8fc 100%);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.tc-wt-drop:hover {
  border-color: color-mix(in srgb, var(--tc-accent) 50%, #c3cdda);
  background: var(--tc-accent-soft);
  transform: translateY(-1px);
  box-shadow: var(--tc-wt-shadow-md);
}
.tc-wt-drop.drag {
  border-color: var(--tc-accent);
  border-style: solid;
  background: var(--tc-accent-soft);
  box-shadow: 0 0 0 4px rgba(0, 120, 212, 0.12);
}
.tc-wt-drop.has-file {
  border-style: solid;
  border-color: color-mix(in srgb, var(--tc-accent) 55%, var(--tc-border));
  color: var(--tc-text);
  background: var(--tc-accent-soft);
}
.tc-wt-drop.has-job {
  cursor: default;
  pointer-events: none;
  transform: none;
}
.tc-wt-drop.has-job .tc-wt-drop-hint--job { color: var(--tc-muted); }

.tc-wt-drop-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: var(--tc-accent-soft);
  color: var(--tc-accent);
}
.tc-wt-drop-icon svg { width: 24px; height: 24px; display: block; }
.tc-wt-drop-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--tc-text);
}
.tc-wt-drop-hint { font-size: 13px; color: #97a2b0; margin-top: 6px; }
.tc-wt-drop-name { font-weight: 600; font-size: 15px; word-break: break-all; }

/* ---------- actions ---------- */

.tc-btn.tc-wt-submit {
  width: 100%;
  margin-top: 22px;
  height: auto;
  min-height: 50px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
}
.tc-btn-primary.tc-wt-submit {
  background: linear-gradient(135deg, #0a6ec4, #1a8fe0);
  border-color: transparent;
  box-shadow: 0 8px 20px -8px rgba(0, 120, 212, 0.65);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.tc-btn-primary.tc-wt-submit:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px -10px rgba(0, 120, 212, 0.7);
}
.tc-btn-primary.tc-wt-submit:active { transform: none; }

.tc-btn.tc-wt-download {
  width: 100%;
  margin-top: 12px;
  height: auto;
  min-height: 50px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  background: linear-gradient(135deg, #0e9a54, #14b866);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(16, 164, 90, 0.6);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.tc-btn.tc-wt-download:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  background: linear-gradient(135deg, #0e9a54, #14b866);
}
.tc-btn.tc-wt-download:active { transform: none; }

.tc-wt-foot {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--tc-border);
  font-size: 12.5px;
  color: #97a2b0;
  text-align: center;
  line-height: 1.6;
}

/* ---------- progress ---------- */

.tc-wt-progress { margin-top: 22px; }
.tc-wt-bar {
  height: 10px;
  border-radius: 999px;
  background: #e8ecf2;
  overflow: hidden;
  position: relative;
}
.tc-wt-bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #14b8a6, #2f6fed);
  transition: width 0.45s ease;
}
.tc-wt-bar.is-indeterminate > i {
  width: 38%;
  transition: none;
  animation: tc-wt-bar-indeterminate 1.35s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes tc-wt-bar-indeterminate {
  0% { margin-left: -38%; }
  100% { margin-left: 100%; }
}
.tc-wt-bar.is-batch-active > i {
  background: linear-gradient(90deg, #14b8a6 0%, #2f6fed 45%, #5b9dff 55%, #2f6fed 100%);
  background-size: 220% 100%;
  animation: tc-wt-bar-shimmer 1.25s linear infinite;
}
@keyframes tc-wt-bar-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.tc-wt-status {
  font-size: 14px;
  color: var(--tc-muted);
  margin: 14px 0 0;
  text-align: center;
  line-height: 1.5;
}
.tc-wt-status.error { color: var(--tc-danger); }

.tc-wt-job-controls {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.tc-wt-job-controls[hidden] { display: none !important; }
.tc-wt-job-controls .tc-btn {
  flex: 1;
  height: auto;
  min-height: 44px;
  font-size: 14px;
  border-radius: 10px;
}

/* ---------- credits pause ---------- */

.tc-wt-credits-pause {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid #f5c451;
  background: linear-gradient(135deg, #fffbeb 0%, #fff6de 100%);
}
.tc-wt-credits-pause[hidden] { display: none !important; }
.tc-wt-credits-pause__title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: #92400e;
}
.tc-wt-credits-pause__hint {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #78350f;
}
.tc-wt-credits-pause__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tc-wt-credits-pause__actions .tc-btn {
  flex: 1 1 140px;
  height: auto;
  min-height: 44px;
  font-size: 14px;
  border-radius: 10px;
}
.tc-wt-credits-pause__actions .tc-btn-primary {
  background: #d97706;
  border-color: #d97706;
}
.tc-wt-credits-pause__actions .tc-btn-primary:hover {
  background: #b45309;
  border-color: #b45309;
}

/* ---------- plans (hidden for now) ---------- */

#plansSection { display: none !important; }

.tc-wt-plans {
  padding: 18px 20px;
  border-radius: var(--tc-wt-card-radius);
  border: 1px solid var(--tc-border);
  background: var(--tc-surface);
  box-shadow: var(--tc-wt-shadow-md);
}
.tc-wt-plans.is-expanded { padding-bottom: 20px; }
.tc-wt-plans-head { display: block; margin-bottom: 0; }
.tc-wt-plans.is-expanded .tc-wt-plans-head { margin-bottom: 14px; }
.tc-wt-plans-toggle {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
  border: none;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tc-wt-plans-toggle:focus-visible {
  outline: 2px solid var(--tc-accent);
  outline-offset: 2px;
  border-radius: 6px;
}
.tc-wt-plans-toggle:hover .tc-wt-plans-chevron {
  background: var(--tc-accent-soft);
  color: var(--tc-accent);
}
.tc-wt-plans-toggle-main { min-width: 0; flex: 1; }
.tc-wt-plans-title {
  display: block;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}
.tc-wt-plans-sub {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--tc-muted);
  line-height: 1.4;
}
.tc-wt-plans-chevron {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f0f3f7;
  color: #6b7280;
  transition: transform 0.22s ease, background 0.15s ease, color 0.15s ease;
}
.tc-wt-plans-chevron svg { display: block; width: 18px; height: 18px; }
.tc-wt-plans-toggle[aria-expanded="true"] .tc-wt-plans-chevron {
  transform: rotate(180deg);
  background: var(--tc-accent-soft);
  color: var(--tc-accent);
}
.tc-wt-plans-body { display: none; }
.tc-wt-plans-body.is-open { display: block; }
.tc-wt-plans .tc-account-plan-list { margin: 0; }
.tc-wt-plans-loading {
  font-size: 13px;
  color: var(--tc-muted);
  padding: 4px 0 2px;
}

/* ---------- footer ---------- */

.tc-wt-page-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 8px 16px calc(28px + env(safe-area-inset-bottom, 0px));
  text-align: center;
}
.tc-wt-page-footer a {
  color: var(--tc-muted);
  font-size: 13px;
  text-decoration: none;
}
.tc-wt-page-footer a:hover { color: var(--tc-accent); }
.tc-wt-page-footer__sep {
  color: #c5cdd8;
  font-size: 13px;
  user-select: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- tablet ---------- */

@media (max-width: 1023px) {
  .tc-wt-main {
    max-width: 720px;
    padding-top: 26px;
  }
}

/* ---------- mobile ---------- */

@media (max-width: 640px) {
  .tc-wt-page { --tc-wt-gap: 14px; --tc-wt-topbar-h: 52px; }

  /* Phones keep the centred form; preview canvas and resume entry stay hidden. */
  .tc-wt-canvas,
  .tc-wt-resume-preview {
    display: none !important;
  }

  .tc-wt-head-download { display: none !important; }

  .tc-header--brand.tc-wt-topbar {
    padding: 0 10px !important;
  }
  /* The centred title duplicates the brand name on narrow screens. */
  .tc-wt-brand-name { display: none; }
  .tc-header--brand h1.tc-wt-page-title { font-size: 15px; }

  .tc-wt-main {
    padding: 18px 14px calc(28px + env(safe-area-inset-bottom, 0px));
  }

  /* Horizontal scroll with snap instead of cramming four tabs into 360px. */
  .tc-tabs {
    align-self: stretch;
    border-radius: 12px;
    padding: 4px;
    scroll-snap-type: x proximity;
  }
  .tc-tabs .tc-tab {
    padding: 9px 14px;
    font-size: 13.5px;
    border-radius: 9px;
    scroll-snap-align: start;
  }
  .tc-tabs .tc-tab.is-active { border-radius: 9px; }

  .tc-wt-card { padding: 20px 16px 18px; border-radius: 14px; }
  .tc-wt-lede { margin-bottom: 18px; font-size: 13.5px; }
  .tc-wt-card .tc-field { margin-bottom: 18px; }

  .tc-wt-drop { padding: 26px 14px; }
  .tc-wt-drop-icon { width: 40px; height: 40px; margin-bottom: 10px; }
  .tc-wt-drop-title { font-size: 14px; }

  /* 16px keeps iOS Safari from zooming the viewport on focus. */
  select.tc-select.tc-wt-lang { font-size: 16px; }
  .tc-wt-card .tc-d2x-prompt { font-size: 16px; }

  .tc-btn.tc-wt-submit,
  .tc-btn.tc-wt-download { min-height: 48px; font-size: 15px; }

  .tc-wt-foot { margin-top: 16px; padding-top: 14px; font-size: 12px; }
}

/* ---------- motion & focus ---------- */

.tc-tab:focus-visible,
.tc-wt-drop:focus-visible,
.tc-wt-plan-link:focus-visible,
.tc-wt-head-download:focus-visible {
  outline: 2px solid var(--tc-accent);
  outline-offset: 2px;
}
.tc-header--brand.tc-wt-topbar .tc-wt-head-download:focus-visible,
.tc-header--brand.tc-wt-topbar .tc-wt-plan-link:focus-visible {
  outline-color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .tc-wt-page *,
  .tc-wt-page *::before,
  .tc-wt-page *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .tc-wt-drop:hover,
  .tc-btn.tc-wt-submit:hover,
  .tc-btn.tc-wt-download:hover,
  .tc-wt-head-download:hover { transform: none; }
}

/* ---------- optional requirement toggle (img2x / pdf2x / imgtr) ---------- */
.tc-wt-card .tc-imgtr-instr-wrap[hidden] {
  display: none !important;
}
.tc-wt-card .tc-imgtr-instr-wrap {
  margin-top: 6px;
}
.tc-wt-card--imgtr .tc-imgtr-instr-toggle {
  margin-top: 8px;
}
.tc-wt-card--imgtr .tc-imgtr-thumbs[hidden],
.tc-imgtr-result[hidden],
.tc-imgtr-compare-nav[hidden] {
  display: none !important;
}
.tc-wt-card--imgtr .tc-imgtr-instruction {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  box-sizing: border-box;
}

.tc-imgtr-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.tc-imgtr-thumb {
  position: relative;
  margin: 0;
  border-radius: 10px;
  border: 1px solid rgba(16, 24, 40, 0.1);
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  overflow: hidden;
  aspect-ratio: 1;
}
.tc-imgtr-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tc-imgtr-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.tc-imgtr-thumb-remove:hover {
  background: rgba(185, 28, 28, 0.92);
}
.tc-imgtr-thumb-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 4px 6px;
  font-size: 10px;
  line-height: 1.3;
  color: #fff;
  background: linear-gradient(transparent, rgba(15, 23, 42, 0.72));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tc-imgtr-web-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.tc-imgtr-web-actions .tc-wt-submit {
  width: 100%;
}
.tc-imgtr-web-actions .tc-imgtr-cancel-btn {
  align-self: center;
  min-height: 32px;
  font-size: 12px;
}
.tc-wt-card--imgtr .tc-imgtr-credit-hint {
  margin: 0;
  text-align: center;
}

.tc-imgtr-result {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(16, 24, 40, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tc-imgtr-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.tc-imgtr-result-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  letter-spacing: -0.01em;
}
.tc-imgtr-compare-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.tc-imgtr-compare-meta {
  font-size: 12px;
  color: var(--tc-muted, #667085);
  margin-right: 2px;
}

/* Override terminology.css .tc-imgtr-compare { display:grid } so [hidden] works
   and web result layout stays a clean 2-up compare, not head+grid as columns. */
.tc-imgtr-compare--web {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: none;
}
.tc-imgtr-compare--web .tc-imgtr-compare-frame {
  min-height: 160px;
  max-height: 360px;
}
.tc-imgtr-compare--web .tc-imgtr-compare-frame img {
  max-height: 340px;
}
.tc-imgtr-result-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.tc-imgtr-result-actions .tc-btn-primary {
  width: 100%;
  min-height: 38px;
  font-weight: 600;
  border-radius: 10px;
}
.tc-imgtr-result-actions .tc-imgtr-link-btn {
  align-self: center;
}

@media (max-width: 720px) {
  .tc-imgtr-compare--web { grid-template-columns: 1fr; }
  .tc-imgtr-compare--web .tc-imgtr-compare-frame {
    max-height: 280px;
  }
  .tc-imgtr-compare--web .tc-imgtr-compare-frame img {
    max-height: 260px;
  }
}
