:root {
  color-scheme: light;
  --ink: #151c27;
  --muted: #6b7280;
  --surface: #f9f9ff;
  --panel: #ffffff;
  --border: #c7c4d8;
  --primary: #3525cd;
  --primary-deep: #3323cc;
  --primary-container: #4f46e5;
  --primary-soft: #e2dfff;
  --surface-container: #e7eefe;
  --surface-container-low: #f0f3ff;
  --surface-container-high: #e2e8f8;
  --secondary: #575e70;
  --secondary-container: #d9dff5;
  --coral: #ba1a1a;
  --gold: #7e3000;
  --blue: #4d44e3;
  --shadow: 0 18px 50px rgba(53, 37, 205, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface);
  color: var(--ink);
  font-family: "Noto Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

html[dir="rtl"] body {
  font-family: "Noto Sans Arabic", "Noto Sans", Tahoma, Arial, sans-serif;
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 1.25em;
  line-height: 1;
  display: inline-block;
  direction: ltr;
  font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  vertical-align: -0.18em;
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(210px, 0.78fr) minmax(340px, 1.1fr) minmax(240px, auto) auto;
  gap: 14px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 10px max(22px, calc((100vw - 1360px) / 2 + 18px));
  border-bottom: 1px solid rgba(217, 222, 214, 0.9);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  box-shadow: 0 4px 18px rgba(23, 33, 31, 0.05);
}

.promo-banner {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 28px;
  padding: 4px 44px;
  border-bottom: 1px solid rgba(143, 56, 48, 0.16);
  background: #f7efd8;
  color: #7f2f2a;
  font-size: 0.78rem;
  font-weight: 750;
  text-align: center;
}

.promo-banner span {
  max-width: min(920px, 100%);
}

.promo-close {
  position: absolute;
  top: 50%;
  inset-inline-end: max(18px, calc((100vw - 1360px) / 2 + 18px));
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  min-height: 22px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #7f2f2a;
  font-size: 1rem;
  font-weight: 900;
  transform: translateY(-50%);
}

.promo-close:hover {
  background: rgba(127, 47, 42, 0.1);
}

.brand {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  gap: 9px;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  display: block;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 6px 16px rgba(67, 97, 238, 0.18);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  white-space: nowrap;
}

.brand small {
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 750;
}

.primary-nav,
.utility-nav,
.secondary-nav,
.top-actions,
.action-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.primary-nav {
  grid-column: 2;
  grid-row: 1;
  justify-content: center;
  min-width: 0;
}

.nav-group {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-link,
.submenu-link,
.admin-entry,
.account-button,
.credit-pill,
.icon-button,
.primary-button,
.secondary-button,
.google-button {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  transition: 150ms ease;
}

.nav-link,
.submenu-link,
.admin-entry {
  padding: 0 11px;
  border-color: transparent;
  background: transparent;
  font-weight: 800;
}

.nav-link {
  position: relative;
}

.nav-link.active::after {
  position: absolute;
  right: 14px;
  bottom: 3px;
  left: 14px;
  height: 2px;
  border-radius: 999px;
  background: var(--primary);
  content: "";
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-deep);
}

.submenu-link {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 32px;
  border-color: transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.submenu-link small {
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(64, 104, 177, 0.11);
  color: var(--blue);
  font-size: 0.64rem;
  font-weight: 900;
}

.secondary-nav {
  width: fit-content;
  margin: 10px auto 0;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 6px 16px rgba(23, 33, 31, 0.05);
}

.submenu-link.active,
.submenu-link:hover {
  background: rgba(20, 116, 95, 0.09);
  color: var(--primary-deep);
}

.badge-link {
  gap: 6px;
  white-space: nowrap;
}

.badge-link small {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  margin-inline-start: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(64, 104, 177, 0.11);
  color: var(--blue);
  font-size: 0.62rem;
  font-weight: 900;
}

.utility-nav {
  position: relative;
  grid-column: 4;
  grid-row: 1;
  justify-content: flex-end;
}

.admin-entry {
  display: none;
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-entry:hover {
  color: var(--primary-deep);
  background: rgba(20, 116, 95, 0.08);
}

.top-actions {
  grid-column: 3;
  grid-row: 1;
  justify-content: flex-end;
  flex-wrap: nowrap;
  margin-inline-end: 0;
}

.ui-language {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

select,
input {
  min-height: 38px;
  padding: 0 11px;
}

textarea {
  resize: vertical;
  min-height: 150px;
  padding: 12px;
  line-height: 1.48;
}

.ui-language select {
  width: auto;
  min-width: 106px;
}

.credit-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 0 12px;
}

.credit-pill strong {
  color: var(--primary);
}

.account-button {
  padding: 0 13px;
  background: var(--ink);
  color: #fff;
}

.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 20;
  display: grid;
  min-width: 210px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.account-menu button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: start;
  font-weight: 800;
}

.account-menu button:hover {
  background: rgba(20, 116, 95, 0.09);
  color: var(--primary-deep);
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.admin-mode .primary-nav,
.admin-mode .top-actions,
.admin-mode #accountButton,
.admin-mode .account-menu,
.admin-mode .secondary-nav,
.admin-mode .promo-banner {
  display: none !important;
}

.admin-mode .topbar {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.admin-mode .utility-nav {
  grid-column: 2;
}

.admin-mode .admin-entry {
  display: inline-flex;
}

.admin-locked .admin-panel {
  display: none;
}

main {
  width: min(1360px, calc(100% - 36px));
  flex: 1;
  margin: 0 auto;
  padding: 14px 0 24px;
}

.roadmap-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.roadmap-strip article {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.roadmap-strip span {
  font-weight: 700;
}

.roadmap-strip strong {
  color: var(--blue);
  font-size: 0.82rem;
  white-space: nowrap;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.86fr);
  gap: 14px;
  align-items: start;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 32px rgba(24, 38, 35, 0.07);
  padding: 16px;
}

.coming-panel {
  min-height: 300px;
  display: grid;
  align-content: center;
  gap: 16px;
}

.coming-panel p:not(.eyebrow) {
  max-width: 740px;
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.58;
}

.context-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.context-footer button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--primary-deep);
  font-weight: 800;
}

.account-panel .primary-button {
  align-self: end;
}

.admin-view {
  max-width: none;
}

.admin-panel {
  border-color: rgba(23, 33, 31, 0.18);
  background: #fff;
}

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

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

.mini-link {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--primary-deep);
  font-size: 0.78rem;
  font-weight: 800;
}

.panel-heading.compact {
  align-items: center;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.12;
}

h1 {
  max-width: 760px;
  font-size: clamp(1.55rem, 2.4vw, 2.45rem);
  letter-spacing: 0;
}

h2 {
  font-size: 1.08rem;
}

.status-chip,
.helper-text,
.notice {
  border-radius: 8px;
  background: rgba(196, 154, 44, 0.13);
  color: #6f581b;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-chip.paid {
  background: rgba(226, 109, 90, 0.12);
  color: #8c3d31;
}

.form-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.stacked {
  margin: 10px 0;
}

.translation-summary {
  min-height: 32px;
  margin: 6px 0 10px;
  padding: 8px 10px;
  border: 1px solid rgba(20, 116, 95, 0.12);
  border-radius: 8px;
  background: rgba(20, 116, 95, 0.06);
  color: var(--primary-deep);
  font-size: 0.8rem;
  font-weight: 800;
}

.translation-summary.warning {
  border-color: rgba(127, 47, 42, 0.2);
  background: #f7efd8;
  color: #7f2f2a;
}

.cost-summary {
  width: fit-content;
  min-width: 130px;
}

.polish-feature-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: -2px 0 12px;
}

.polish-feature-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(20, 116, 95, 0.18);
  border-radius: 999px;
  background: rgba(20, 116, 95, 0.06);
  color: var(--primary-deep);
  font-size: 0.78rem;
  font-weight: 800;
}

.primary-button,
.secondary-button,
.google-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  font-weight: 800;
}

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

.primary-button:hover {
  background: var(--primary-deep);
}

.secondary-button:hover,
.icon-button:hover,
.credit-pill:hover {
  border-color: rgba(20, 116, 95, 0.45);
}

.secondary-button small {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(20, 116, 95, 0.1);
  color: var(--primary);
}

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

.target-tile {
  position: relative;
}

.target-tile input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.target-tile span {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 42px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.target-tile small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.target-tile.disabled span {
  background: #f4f3ef;
  color: var(--muted);
}

.target-tile input:checked + span {
  border-color: var(--primary);
  background: rgba(20, 116, 95, 0.09);
  color: var(--primary-deep);
}

.target-tile span::after {
  content: "+";
  color: var(--muted);
}

.target-tile input:checked + span::after {
  content: "✓";
  color: var(--primary);
}

.helper-text {
  margin: 8px 0 10px;
  padding: 8px 10px;
  font-size: 0.8rem;
}

.result-list,
.ledger-list {
  display: grid;
  gap: 10px;
}

.result-card,
.ledger-item,
.locked-message,
.output-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.empty-result {
  min-height: 96px;
  display: grid;
  place-items: center;
  text-align: center;
}

.result-card {
  overflow: hidden;
}

.result-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.result-card strong {
  color: var(--primary-deep);
}

.result-card p {
  margin: 0;
  padding: 12px;
  min-height: 58px;
  white-space: pre-wrap;
  line-height: 1.55;
}

.icon-button {
  min-width: 42px;
  padding: 0 12px;
  color: var(--primary-deep);
  font-weight: 800;
}

.output-box {
  min-height: 180px;
  padding: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  color: var(--muted);
}

.glossary-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: start;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.locked-message {
  display: grid;
  gap: 6px;
  padding: 18px;
  color: var(--muted);
}

.locked-message .auth-cta {
  width: fit-content;
  margin-top: 10px;
}

.empty-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.verification-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.subtle {
  margin: 10px 0;
}

.locked-message strong {
  color: var(--ink);
}

.hidden {
  display: none !important;
}

.credits-grid {
  grid-template-columns: 0.7fr 1.3fr;
}

.metric-panel h1 {
  color: var(--primary-deep);
  font-size: clamp(3rem, 8vw, 7rem);
}

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

.ledger-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
}

.ledger-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.admin-metrics article {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.admin-metrics strong {
  display: block;
  margin-top: 6px;
  color: var(--primary-deep);
  font-size: 1.8rem;
}

.admin-action-cell {
  display: flex;
  justify-content: center;
  overflow: visible;
}

.admin-credit-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  border: 1px solid rgba(20, 116, 95, 0.24);
  border-radius: 8px;
  background: rgba(20, 116, 95, 0.08);
  color: var(--primary-deep);
  font-size: 1.18rem;
  font-weight: 900;
}

.admin-credit-button:hover {
  border-color: rgba(20, 116, 95, 0.54);
  background: rgba(20, 116, 95, 0.14);
}

.admin-credit-button::after {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 10;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  content: attr(data-tooltip);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: 140ms ease;
  white-space: nowrap;
}

.admin-credit-button:hover::after,
.admin-credit-button:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 33, 31, 0.38);
}

.modal {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.22);
}

.auth-modal {
  width: min(720px, 100%);
  overflow: visible;
}

.modal h2 {
  margin-bottom: 5px;
  font-size: 1.55rem;
}

.modal p {
  color: var(--muted);
  line-height: 1.55;
}

.auth-gift {
  margin-bottom: 10px;
  padding: 7px 10px;
  border: 1px solid rgba(143, 56, 48, 0.16);
  border-radius: 8px;
  background: #f7efd8;
  color: #7f2f2a;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.auth-tabs,
.auth-methods {
  display: grid;
  gap: 6px;
  margin: 10px 0;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f6f5f0;
}

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

.auth-methods {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 8px;
}

.auth-tab,
.auth-method {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.auth-tab.active,
.auth-method.active {
  background: #fff;
  color: var(--primary-deep);
  box-shadow: 0 4px 14px rgba(23, 33, 31, 0.06);
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 12px;
  align-items: stretch;
}

.auth-grid.single {
  grid-template-columns: minmax(0, 1fr);
}

.auth-card {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfaf6;
}

.auth-card .full {
  align-self: end;
}

.section-label {
  margin: 0;
  color: var(--primary-deep);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.google-provider-slot {
  margin: 8px 0;
}

.modal-close {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 1.2rem;
}

#adminAuthModal input {
  background: #fff;
}

#adminAuthModal input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  -webkit-text-fill-color: var(--ink);
  transition: background-color 5000s ease-in-out 0s;
}

#adminPassword {
  -webkit-text-security: disc;
}

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

.google-button {
  margin: 8px 0 12px;
  border-color: #d4d8d4;
}

.google-logo {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.human-check {
  display: grid;
  grid-template-columns: auto 42px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  margin: 0;
}

.captcha-preview {
  display: grid;
  place-items: center;
  min-width: 92px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px dashed rgba(20, 116, 95, 0.38);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(20, 116, 95, 0.11), rgba(196, 154, 44, 0.14)),
    #fff;
  color: var(--primary-deep);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.divider {
  display: grid;
  place-items: center;
  margin: 10px 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 36px));
}

html[dir="rtl"] .toast-stack {
  right: auto;
  left: 18px;
}

.toast {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  line-height: 1.45;
}

.toast-actionable {
  cursor: pointer;
}

.toast button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 800;
}

.danger-text {
  color: var(--coral);
  font-weight: 800;
}

.site-footer {
  width: 100%;
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 0.78rem;
}

.footer-inner {
  width: min(1360px, calc(100% - 36px));
  margin: 0 auto;
  padding: 22px 0 18px;
}

.footer-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.footer-brand img {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  object-fit: cover;
}

.footer-brand strong,
.footer-brand span {
  display: block;
}

.footer-brand strong {
  color: var(--ink);
  font-size: 0.96rem;
}

.footer-brand span {
  color: var(--primary);
  font-weight: 800;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.footer-nav div {
  display: grid;
  gap: 7px;
  align-content: start;
}

.footer-nav h2 {
  margin: 0 0 2px;
  color: var(--ink);
  font-size: 0.82rem;
}

.footer-nav a,
.footer-nav button {
  color: var(--primary-deep);
  text-decoration: none;
  font-weight: 750;
}

.footer-nav button {
  width: fit-content;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: start;
}

.footer-nav a:hover,
.footer-nav button:hover {
  color: var(--primary);
}

.footer-bottom {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(217, 222, 214, 0.72);
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .brand,
  .primary-nav,
  .top-actions,
  .utility-nav {
    grid-column: 1;
    grid-row: auto;
  }

  .primary-nav,
  .utility-nav,
  .top-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-inline-end: 0;
  }

  html[dir="rtl"] .primary-nav,
  html[dir="rtl"] .utility-nav,
  html[dir="rtl"] .top-actions {
    justify-content: flex-end;
  }

  .workspace-grid,
  .credits-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 0;
  }

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

  .brand {
    flex: 1 1 100%;
  }

  .brand small {
    display: none;
  }

  .primary-nav {
    flex: 1 1 100%;
    gap: 4px;
  }

  .nav-link {
    min-height: 34px;
    padding: 0 8px;
  }

  .utility-nav,
  .top-actions {
    flex: 0 1 auto;
  }

  .account-button,
  .credit-pill,
  .ui-language select {
    min-height: 38px;
  }

  .roadmap-strip,
  .form-grid.two,
  .auth-grid,
  .verification-row,
  .human-check,
  .target-grid,
  .glossary-form,
  .admin-metrics {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 14px;
  }

  .panel-heading {
    flex-direction: column;
  }

  h1 {
    font-size: 1.72rem;
  }

  .auth-modal {
    width: min(460px, 100%);
    overflow: auto;
  }

  .footer-nav {
    grid-template-columns: 1fr;
  }
}

/* Stitch UI upgrade */
.topbar {
  grid-template-columns: minmax(180px, auto) 1fr auto auto;
  gap: 28px;
  min-height: 68px;
  padding: 0 max(32px, calc((100vw - 1280px) / 2 + 24px));
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
}

.brand {
  gap: 0;
}

.brand-mark {
  display: none;
}

.brand strong {
  color: var(--primary);
  font-family: "Hanken Grotesk", "Noto Sans", sans-serif;
  font-size: 1.72rem;
  font-weight: 800;
  line-height: 1;
}

.brand small {
  display: none;
}

.primary-nav {
  justify-content: flex-start;
  gap: 24px;
}

.nav-link,
.submenu-link,
.admin-entry {
  color: var(--secondary);
  font-size: 1.02rem;
  font-weight: 600;
}

.nav-link.active,
.nav-link:hover {
  color: var(--primary);
}

.nav-link.active::after {
  right: 0;
  bottom: -17px;
  left: 0;
  height: 3px;
  background: var(--primary);
}

.badge-link small,
.submenu-link small {
  background: var(--primary-soft);
  color: var(--primary);
}

.top-actions {
  gap: 14px;
}

.credit-pill {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--secondary);
  font-size: 0.88rem;
  font-weight: 700;
}

.credit-pill span::after {
  content: ":";
}

.credit-pill strong {
  color: var(--secondary);
}

.account-button {
  position: relative;
  min-height: 44px;
  padding: 0 0 0 34px;
  border: 0;
  border-bottom: 3px solid var(--primary);
  border-radius: 0;
  background: transparent;
  color: var(--primary);
  font-size: 1.02rem;
  font-weight: 700;
}

.account-button::before {
  position: absolute;
  left: 0;
  top: 50%;
  font-family: "Material Symbols Outlined";
  font-size: 1.55rem;
  content: "account_circle";
  transform: translateY(-50%);
}

html[dir="rtl"] .account-button {
  padding: 0 34px 0 0;
}

html[dir="rtl"] .account-button::before {
  right: 0;
  left: auto;
}

.ui-language select,
select,
input,
textarea {
  border-color: var(--border);
  background: var(--surface-container-low);
  color: var(--ink);
}

select:focus,
input:focus,
textarea:focus {
  outline: 3px solid rgba(79, 70, 229, 0.18);
  border-color: var(--primary-container);
}

.promo-banner {
  border-color: rgba(199, 196, 216, 0.72);
  background: var(--surface-container-low);
  color: var(--secondary);
}

.promo-close {
  color: var(--secondary);
}

.secondary-nav {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  justify-content: flex-start;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid rgba(199, 196, 216, 0.72);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.submenu-link.active,
.submenu-link:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

main {
  width: min(1280px, calc(100% - 48px));
  padding: 40px 0 48px;
}

h1,
h2,
.panel-heading h2,
.account-page-heading h1 {
  font-family: "Hanken Grotesk", "Noto Sans", sans-serif;
}

h1 {
  color: var(--primary);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
}

h2 {
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 700;
}

.workspace-grid {
  gap: 24px;
}

.panel,
.result-card,
.ledger-item,
.locked-message,
.output-box,
.table-wrap,
.auth-card,
.modal {
  border-color: var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
}

.panel {
  padding: 24px;
}

.eyebrow,
.mini-link,
.result-card strong,
.target-tile input:checked + span,
.translation-summary,
.polish-feature-row span,
.account-menu button:hover {
  color: var(--primary);
}

.status-chip,
.helper-text,
.notice {
  background: var(--surface-container-low);
  color: var(--secondary);
}

.status-chip.paid {
  background: var(--primary-soft);
  color: var(--primary);
}

.primary-button,
.secondary-button,
.google-button {
  min-height: 44px;
  border-radius: 12px;
}

.primary-button {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(53, 37, 205, 0.16);
}

.primary-button:hover {
  border-color: var(--primary-container);
  background: var(--primary-container);
}

.secondary-button,
.google-button,
.icon-button,
.mini-link {
  border-color: var(--border);
  background: #fff;
  color: var(--primary);
}

.translation-summary,
.target-tile input:checked + span,
.polish-feature-row span {
  border-color: rgba(79, 70, 229, 0.24);
  background: var(--primary-soft);
}

.target-tile span {
  border-color: var(--border);
  background: #fff;
}

.target-tile.disabled span {
  background: var(--surface-container-low);
}

.account-workspace {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.account-sidebar {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 40px;
}

.account-sidebar nav {
  display: grid;
  gap: 8px;
}

.account-sidebar button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--secondary);
  font-size: 1rem;
  font-weight: 700;
  text-align: start;
}

.account-sidebar button:hover {
  background: var(--surface-container-high);
  color: var(--primary);
}

.account-sidebar button.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 24px rgba(53, 37, 205, 0.16);
}

.sidebar-separator {
  display: block;
  height: 1px;
  margin: 18px 0;
  background: var(--border);
}

.sidebar-upgrade {
  display: none;
  padding: 24px;
  border-radius: 16px;
  background: var(--secondary-container);
}

.sidebar-upgrade p {
  margin: 0 0 18px;
  color: var(--secondary);
  font-size: 1.02rem;
  line-height: 1.28;
}

.sidebar-upgrade button {
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  background: var(--primary);
  color: #fff;
}

.account-main {
  display: grid;
  gap: 28px;
  min-width: 0;
}

.account-page-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.account-page-heading h1 {
  margin: 0;
  color: var(--primary);
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1;
}

.account-page-heading p {
  margin: 12px 0 0;
  color: var(--secondary);
  font-size: 1.08rem;
}

.buy-credits-button {
  min-width: 220px;
  min-height: 56px;
  font-size: 1.02rem;
}

.credit-overview-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.95fr) minmax(360px, 2fr);
  gap: 24px;
}

.metric-panel {
  position: relative;
  min-height: 214px;
  overflow: hidden;
}

.metric-panel::after {
  position: absolute;
  right: -18px;
  top: -22px;
  color: var(--ink);
  content: "account_balance_wallet";
  font-family: "Material Symbols Outlined";
  font-size: 8rem;
  opacity: 0.05;
}

.metric-label {
  color: var(--secondary);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.metric-panel h1 {
  display: inline-block;
  margin-top: 22px;
  color: var(--ink);
  font-family: "Hanken Grotesk", "Noto Sans", sans-serif;
  font-size: clamp(3.4rem, 7vw, 5rem);
  line-height: 0.9;
}

.credit-unit {
  display: inline-block;
  margin: 0 0 0 12px;
  color: var(--secondary);
  font-size: 1.2rem;
}

.metric-panel strong {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 30px;
  color: var(--primary);
  font-size: 1.05rem;
}

.usage-panel {
  display: grid;
  gap: 24px;
}

.usage-row {
  display: grid;
  gap: 10px;
}

.usage-row div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 1rem;
}

.usage-row strong {
  color: var(--primary);
}

.usage-row.polish strong {
  color: var(--gold);
}

progress {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--surface-container);
}

progress::-webkit-progress-bar {
  background: var(--surface-container);
}

progress::-webkit-progress-value {
  background: var(--primary);
  border-radius: 999px;
}

.usage-row.polish progress::-webkit-progress-value {
  background: var(--gold);
}

progress::-moz-progress-bar {
  background: var(--primary);
  border-radius: 999px;
}

.history-panel {
  overflow: hidden;
  padding: 0;
}

.history-panel .panel-heading {
  margin: 0;
  padding: 26px 32px;
  border-bottom: 1px solid var(--border);
}

.ledger-list {
  gap: 0;
}

.ledger-head {
  display: grid;
  grid-template-columns: 190px minmax(280px, 1fr) 180px 120px;
  gap: 18px;
  padding: 16px 32px;
  background: var(--surface-container-low);
  color: var(--secondary);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ledger-item {
  display: grid;
  grid-template-columns: 190px minmax(280px, 1fr) 180px 120px;
  gap: 18px;
  align-items: center;
  padding: 18px 32px;
  border-width: 0 0 1px;
  border-radius: 0;
  color: var(--ink);
}

.ledger-item small {
  margin: 0;
  color: var(--ink);
  font-size: 0.96rem;
}

.ledger-item span {
  font-size: 0.98rem;
}

.ledger-item strong {
  justify-self: end;
  font-size: 1rem;
}

.ledger-item strong.positive {
  color: var(--primary);
}

.ledger-item strong.negative {
  color: var(--coral);
}

.service-pill {
  justify-self: start;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-style: normal;
  font-size: 0.82rem;
  font-weight: 800;
}

.service-pill.polish {
  background: #ffdbcc;
  color: var(--gold);
}

.service-pill.payment {
  background: var(--secondary-container);
  color: var(--secondary);
}

.history-panel .notice {
  margin: 18px 32px 28px;
}

.account-panel {
  max-width: 820px;
}

.site-footer {
  border-top-color: var(--border);
  background: #e7eefe;
  color: var(--secondary);
  font-size: 0.95rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 28px;
  align-items: center;
  width: min(1280px, calc(100% - 48px));
  padding: 34px 0;
}

.footer-brand {
  margin: 0;
}

.footer-brand img {
  display: none;
}

.footer-brand strong {
  color: var(--primary);
  font-family: "Hanken Grotesk", "Noto Sans", sans-serif;
  font-size: 1.12rem;
  line-height: 1;
}

.footer-brand span,
.footer-site {
  color: var(--secondary);
  font-size: 0.82rem;
  font-weight: 700;
}

.footer-nav {
  display: flex;
  justify-content: flex-end;
  gap: 34px;
}

.footer-nav div {
  display: contents;
}

.footer-nav h2 {
  display: none;
}

.footer-nav a,
.footer-nav button {
  color: var(--secondary);
  font-size: 0.95rem;
  font-weight: 500;
}

.footer-bottom {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 1fr;
    padding: 14px 24px;
  }

  .nav-link.active::after {
    bottom: -6px;
  }

  .account-workspace,
  .credit-overview-grid {
    grid-template-columns: 1fr;
  }

  .account-sidebar {
    position: static;
  }

  .account-sidebar nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sidebar-upgrade {
    display: none;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    grid-column: 1;
    grid-row: auto;
  }

  .footer-nav {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  main,
  .secondary-nav,
  .footer-inner {
    width: min(100% - 32px, 1280px);
  }

  .account-sidebar nav {
    grid-template-columns: 1fr;
  }

  .account-page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .buy-credits-button {
    width: 100%;
  }

  .ledger-head,
  .ledger-item {
    grid-template-columns: 1fr;
  }
}

/* Stitch auth modal upgrade */
#authModal.modal-backdrop {
  background: rgba(21, 28, 39, 0.46);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.auth-modal {
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: hidden;
  border-color: rgba(199, 196, 216, 0.9);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 28px 72px rgba(21, 28, 39, 0.3);
}

.auth-modal .modal-close {
  top: 10px;
  inset-inline-end: 10px;
  z-index: 2;
  width: 30px;
  height: 30px;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--secondary);
}

.auth-modal .auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  border-width: 0 0 1px;
  border-color: var(--border);
  border-radius: 0;
  background: #fff;
}

.auth-tabs.reset-active {
  display: none;
}

.auth-modal .auth-tab {
  min-height: 58px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
}

.auth-modal .auth-tab.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
  box-shadow: none;
}

.auth-modal-body {
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  padding: 36px 32px 32px;
}

.auth-brand-lockup {
  margin-bottom: 30px;
  text-align: center;
}

.auth-brand-lockup h2 {
  margin: 0;
  color: var(--primary);
  font-family: "Hanken Grotesk", "Noto Sans", sans-serif;
  font-size: 1.7rem;
  font-weight: 800;
}

.auth-brand-lockup p {
  margin: 6px 0 0;
  color: var(--secondary);
  font-size: 0.94rem;
}

.auth-social-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 28px;
}

.auth-modal .google-button {
  margin: 0;
  min-height: 48px;
  border-color: var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  box-shadow: none;
}

.auth-modal .google-button:hover {
  background: var(--surface-subtle, #f3f4f6);
}

.auth-modal .google-logo {
  width: 20px;
  height: 20px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 28px;
  color: var(--outline);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  flex: 1;
  background: var(--border);
  content: "";
}

.auth-modal .auth-grid,
.auth-modal .auth-grid.single {
  display: block;
}

.auth-modal .auth-card {
  display: grid;
  gap: 20px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.auth-modal label {
  gap: 8px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}

.auth-modal input {
  min-height: 50px;
  border-color: transparent;
  border-radius: 8px;
  background: #f3f4f6;
  font-size: 1rem;
}

.auth-modal input:focus {
  outline: 3px solid rgba(79, 70, 229, 0.18);
  border-color: var(--primary);
  background: #fff;
}

.password-label-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.inline-link {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
}

.inline-link:hover,
.auth-agreement button:hover {
  text-decoration: underline;
}

.inline-link.centered {
  justify-self: center;
}

.auth-modal .primary-button,
.auth-modal .secondary-button.full {
  min-height: 52px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3525cd 0%, #4f46e5 100%);
  color: #fff;
  box-shadow: 0 14px 28px rgba(53, 37, 205, 0.22);
}

.auth-modal .secondary-button:not(.full) {
  min-height: 50px;
  border-color: rgba(53, 37, 205, 0.22);
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary);
}

.field-hint {
  margin: -12px 0 0;
  color: var(--outline);
  font-size: 0.76rem;
}

.auth-modal .verification-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.auth-modal .human-check {
  grid-template-columns: minmax(82px, auto) 42px minmax(0, 1fr);
}

.auth-modal .captcha-preview {
  border-color: rgba(79, 70, 229, 0.28);
  background: var(--surface-container-low);
  color: var(--primary);
}

.password-strength {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.password-strength i {
  height: 4px;
  border-radius: 999px;
  background: var(--surface-container-highest);
}

.password-strength i:first-child,
.password-strength i:nth-child(2) {
  background: var(--primary-fixed-dim);
}

.reset-copy h3 {
  margin: 0;
  color: var(--primary);
  font-family: "Hanken Grotesk", "Noto Sans", sans-serif;
  font-size: 1.35rem;
}

.reset-copy p {
  margin: 6px 0 0;
  color: var(--secondary);
  line-height: 1.5;
}

.auth-agreement {
  margin: 30px 0 0;
  color: var(--secondary);
  font-size: 0.88rem;
  line-height: 1.45;
  text-align: center;
}

.auth-agreement button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
}

.legal-modal {
  width: min(620px, calc(100vw - 32px));
}

.legal-body {
  display: grid;
  gap: 12px;
  color: var(--secondary);
  line-height: 1.58;
}

.legal-body h3 {
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 1rem;
}

.legal-body p {
  margin: 0;
}

@media (max-width: 560px) {
  .auth-modal-body {
    padding: 28px 20px 24px;
  }

  .auth-modal .verification-row,
  .auth-modal .human-check {
    grid-template-columns: 1fr;
  }
}

/* Stitch Translate workspace */
.translate-workspace {
  display: grid;
  gap: 32px;
  padding: 26px 0 16px;
}

.translate-tabs-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.translate-mode-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-container-low);
}

.translate-mode-tabs button,
.glossary-toolbar-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--secondary);
  font-weight: 700;
}

.translate-mode-tabs button {
  display: inline-flex;
  justify-content: center;
  gap: 8px;
  align-items: center;
  min-width: 164px;
  padding: 0 22px;
}

.translate-mode-tabs small {
  display: inline-grid;
  place-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.translate-mode-tabs button.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 6px 18px rgba(53, 37, 205, 0.08);
}

.translate-mode-tabs .disabled-tab {
  cursor: default;
}

.glossary-toolbar-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 0 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
}

.glossary-toolbar-button:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #fff;
}

.translation-studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 1fr);
  gap: 24px;
  align-items: start;
}

.source-workbench,
.translation-result-card,
.add-target-card,
.update-card,
.polish-teaser-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.source-workbench {
  display: flex;
  flex-direction: column;
  min-height: 560px;
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.source-workbench:focus-within {
  border-color: var(--blue);
  box-shadow: 0 16px 40px rgba(53, 37, 205, 0.08);
}

.source-workbench-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 70px;
  padding: 14px 26px;
  border-bottom: 1px solid var(--border);
  background: #fbfbff;
}

.source-language-field {
  display: block;
}

.source-language-field select,
.target-language-select,
.add-target-select {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--secondary);
  font-weight: 750;
}

.source-language-field select:focus,
.target-language-select:focus,
.add-target-select:focus {
  outline: 2px solid rgba(79, 70, 229, 0.18);
  border-radius: 8px;
}

.engine-control {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--secondary);
  font-weight: 600;
}

.engine-toggle {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.engine-toggle button {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--secondary);
  font-weight: 750;
}

.engine-toggle button.active {
  background: var(--primary);
  color: #fff;
}

.source-workbench textarea {
  width: 100%;
  flex: 1;
  min-height: 360px;
  padding: 40px 38px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.7;
  resize: none;
}

.source-workbench textarea:focus {
  outline: none;
}

.source-workbench textarea::placeholder {
  color: var(--ink);
  opacity: 0.9;
}

.source-workbench-footer {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.source-meter-group {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 0.9rem;
}

.source-counter {
  font-weight: 700;
}

.free-left {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
}

.credit-estimate {
  display: inline-grid;
  grid-template-columns: auto auto;
  column-gap: 5px;
  align-items: center;
  color: var(--secondary);
  font-size: 0.78rem;
  font-weight: 800;
}

.credit-estimate strong {
  grid-column: 2;
  color: var(--ink);
}

.source-workbench-footer .translation-summary {
  grid-column: 1 / -1;
  min-height: 0;
  margin: -4px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 0.78rem;
}

.source-workbench-footer .translation-summary.warning {
  color: #7f2f2a;
}

.translate-action-button {
  justify-self: end;
  min-width: 150px;
  min-height: 50px;
  border-radius: 12px;
  box-shadow: 0 12px 22px rgba(53, 37, 205, 0.16);
}

.target-results-pane {
  display: grid;
  gap: 14px;
}

.target-results-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  min-height: 0;
}

.target-results-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
}

.target-results-heading .helper-text {
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--secondary);
  font-size: 0.82rem;
}

.target-card-list {
  gap: 16px;
}

.translation-result-card {
  overflow: hidden;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.translation-result-card:hover {
  box-shadow: 0 14px 32px rgba(53, 37, 205, 0.1);
}

.translation-result-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 70px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-container-low);
}

.target-language-control {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.target-language-select {
  max-width: 210px;
  text-transform: uppercase;
}

.target-verified {
  color: var(--primary);
  font-size: 1rem;
}

.target-loading {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
}

.target-loading .material-symbols-outlined {
  font-size: 1rem;
  animation: spin 1s linear infinite;
}

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

.copy-result-button,
.add-target-button,
.footer-icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--secondary);
}

.copy-result-button:hover,
.add-target-button:hover {
  background: var(--surface-container-high);
  color: var(--primary);
}

.translation-result-body {
  min-height: 124px;
  padding: 26px 28px;
}

.translation-result-body p {
  margin: 0;
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.translation-result-card.loading .translation-result-body {
  background: linear-gradient(90deg, transparent, rgba(77, 68, 227, 0.05), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
}

.cultural-polish-button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin: 0 24px 16px;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 800;
}

.cultural-polish-button:disabled {
  display: none;
}

.add-target-card {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 126px;
  border-style: dashed;
  border-width: 2px;
  background: transparent;
  color: var(--secondary);
  text-align: center;
}

.add-target-card:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(79, 70, 229, 0.04);
}

.add-target-control {
  display: inline-flex;
  gap: 12px;
  align-items: center;
}

.add-target-select {
  min-width: 168px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-weight: 600;
}

.add-target-button .material-symbols-outlined {
  font-size: 2rem;
}

.translate-info-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.95fr);
  gap: 24px;
}

.update-card,
.polish-teaser-card {
  min-height: 250px;
  padding: 28px;
}

.update-card {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(90deg, #fff, #f1f0ff);
}

.update-card h2,
.polish-teaser-card h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-family: "Hanken Grotesk", "Noto Sans", sans-serif;
  font-size: 1.55rem;
}

.update-card p,
.polish-teaser-card p {
  max-width: 560px;
  margin: 0;
  color: var(--secondary);
  font-size: 1rem;
  line-height: 1.55;
}

.suggestion-button {
  width: fit-content;
  min-height: 44px;
  margin-top: 22px;
  border-radius: 8px;
  text-decoration: none;
}

.update-card-icon {
  align-self: center;
  color: rgba(53, 37, 205, 0.18);
  font-size: 7.5rem;
  transform: rotate(12deg);
}

.polish-teaser-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #dce2f3;
}

.polish-teaser-card h2 {
  font-size: 1rem;
}

.polish-teaser-card button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  width: fit-content;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 800;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-container);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 48px;
  align-items: center;
  width: min(1280px, calc(100% - 80px));
  padding: 34px 0;
}

.footer-brand {
  display: grid;
  gap: 5px;
  margin: 0;
}

.footer-brand strong {
  color: var(--primary);
  font-family: "Hanken Grotesk", "Noto Sans", sans-serif;
  font-size: 1.05rem;
  line-height: 1;
}

.footer-brand span {
  color: var(--secondary);
  font-size: 0.78rem;
  font-weight: 700;
}

.footer-brand em {
  margin-top: 8px;
  color: var(--secondary);
  font-size: 0.9rem;
}

.footer-brand small {
  color: var(--secondary);
  font-size: 0.88rem;
}

.footer-nav {
  display: flex;
  gap: 34px;
  align-items: center;
}

.footer-nav a,
.footer-nav button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--secondary);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}

.footer-nav a:hover,
.footer-nav button:hover,
.footer-icon-button:hover {
  color: var(--primary);
}

.footer-actions {
  display: flex;
  gap: 14px;
}

.footer-icon-button {
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
}

html[dir="rtl"] .source-workbench textarea,
html[dir="rtl"] .translation-result-body {
  text-align: start;
}

@media (max-width: 1100px) {
  .translation-studio-grid,
  .translate-info-grid {
    grid-template-columns: 1fr;
  }

  .source-workbench {
    min-height: 480px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-nav {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 720px) {
  .translate-tabs-row,
  .source-workbench-header,
  .source-workbench-footer,
  .target-results-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .translate-mode-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .translate-mode-tabs button {
    min-width: 150px;
  }

  .source-workbench-footer {
    display: flex;
  }

  .translate-action-button,
  .glossary-toolbar-button {
    width: 100%;
  }

  .engine-control {
    justify-content: space-between;
  }

  .update-card {
    min-height: 0;
  }

  .update-card-icon {
    display: none;
  }
}

/* Polish workspace refinement */
#view-polish .heading-actions {
  flex-wrap: nowrap;
}

.polish-glossary-link {
  min-height: 32px;
  padding: 0 12px;
  border-color: rgba(126, 48, 0, 0.18);
  border-radius: 999px;
  background: #ffdbcc;
  color: var(--gold);
  white-space: nowrap;
}

.polish-glossary-link:hover {
  border-color: rgba(126, 48, 0, 0.32);
  background: #ffceb9;
  color: var(--gold);
}

.polish-action-row {
  display: grid;
  grid-template-columns: minmax(160px, auto) minmax(220px, 1fr);
  gap: 14px;
  align-items: center;
  margin-top: 14px;
}

.polish-credit-estimate {
  margin: 0;
  justify-self: start;
}

.polish-content-button {
  justify-self: end;
  width: min(100%, 360px);
  min-height: 54px;
  border-radius: 10px;
  background: var(--primary);
  box-shadow: 0 12px 22px rgba(53, 37, 205, 0.16);
  font-size: 1.02rem;
}

.polish-content-button .material-symbols-outlined {
  font-size: 1.18rem;
}

.polish-intelligence-panel {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.polish-notes-heading {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 18px 22px 10px;
  color: var(--secondary);
}

.polish-notes-heading h3 {
  margin: 0;
  color: var(--secondary);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.polish-note-list {
  display: grid;
  gap: 12px;
  padding: 12px 22px 24px;
}

.polish-note-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding: 18px 20px;
  border-left: 5px solid var(--primary);
  border-radius: 8px;
  background: var(--surface-container-low);
  color: var(--ink);
}

html[dir="rtl"] .polish-note-card {
  border-right: 5px solid var(--primary);
  border-left: 0;
}

.polish-note-card.empty {
  color: var(--secondary);
}

.polish-note-card .material-symbols-outlined {
  color: var(--primary);
  font-size: 1.6rem;
}

.polish-note-card h4 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 1rem;
}

.polish-note-card p {
  margin: 0;
  color: var(--on-surface-variant, #464555);
  line-height: 1.55;
}

.glossary-applied-panel {
  display: grid;
  gap: 12px;
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface-container-low);
}

.glossary-applied-summary {
  display: inline-flex;
  width: fit-content;
  gap: 7px;
  align-items: center;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--secondary);
  font-size: 0.85rem;
}

.glossary-applied-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--secondary);
  font-size: 0.82rem;
}

.glossary-applied-list.empty {
  font-style: italic;
}

.glossary-applied-list span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--secondary);
}

.glossary-applied-list small {
  color: var(--primary);
  font-weight: 700;
}

@media (max-width: 720px) {
  .polish-action-row {
    grid-template-columns: 1fr;
  }

  .polish-content-button {
    width: 100%;
  }
}
