:root {
  --bg: #eef3f7;
  --bg-strong: #dce5eb;
  --card: rgba(255, 255, 255, 0.9);
  --card-solid: #ffffff;
  --ink: #11243a;
  --muted: #61748b;
  --line: rgba(17, 36, 58, 0.12);
  --line-strong: rgba(17, 36, 58, 0.2);
  --accent: #0c7c6d;
  --accent-strong: #085f54;
  --accent-soft: #dff5ef;
  --gold: #b68928;
  --surface: #f7fbfd;
  --shadow: 0 20px 50px rgba(14, 30, 48, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(12, 124, 109, 0.14), transparent 24%),
    radial-gradient(circle at 90% 10%, rgba(182, 137, 40, 0.1), transparent 22%),
    linear-gradient(180deg, #fbfdff 0%, var(--bg) 100%);
}

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

button {
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

.secondary-btn,
.ghost-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
}

.secondary-btn:hover,
.ghost-btn:hover {
  background: #fff;
  border-color: var(--accent);
}

.site-shell {
  max-width: 1680px;
  margin: 0 auto;
  padding: 24px;
}

.landing-shell,
.app-layout {
  display: grid;
  gap: 22px;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 4px;
}

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

.brand strong {
  display: block;
  font-size: 20px;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), #1c9989);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 12px 26px rgba(12, 124, 109, 0.24);
}

.nav-actions,
.hero-actions,
.topbar-actions,
.job-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-grid {
  display: grid;
  gap: 26px;
  grid-template-columns: minmax(0, 1.4fr) minmax(360px, 520px);
  align-items: start;
}

.hero-grid--centered {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.hero-copy {
  padding: 24px 8px 8px 4px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-copy h1,
.topbar h1 {
  margin: 0 0 16px;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero-copy h1 {
  font-size: clamp(42px, 6vw, 74px);
  line-height: 0.96;
  max-width: 11ch;
}

.hero-text,
.subtitle,
.job-meta,
.notification-meta,
.metric-card span {
  color: var(--muted);
}

.hero-text {
  max-width: 66ch;
  font-size: 18px;
  line-height: 1.65;
  margin-bottom: 24px;
}

.role-cards,
.metrics-row,
.language-grid,
.dashboard-grid,
.admin-columns {
  display: grid;
  gap: 16px;
}

.role-cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 26px;
}

.feature-card,
.metric-card,
.card,
.auth-card,
.job-card,
.notification-card,
.simple-item {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.feature-card,
.metric-card {
  padding: 18px;
}

.feature-card h2,
.metric-card strong,
.section-head h2,
.auth-card h2 {
  margin: 0 0 8px;
}

.feature-card p,
.metric-card span,
.notification-card p,
.simple-item p,
.job-card p {
  margin-bottom: 0;
}

.metrics-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.metric-card strong {
  display: block;
  font-size: 24px;
}

.auth-panel {
  position: sticky;
  top: 24px;
}

.auth-card,
.card {
  padding: 22px;
}

.auth-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  padding: 4px;
  margin-bottom: 18px;
  background: rgba(17, 36, 58, 0.05);
  border-radius: 18px;
}

.auth-tab {
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.auth-tab.is-active {
  background: #fff;
  color: var(--ink);
  border: 1px solid rgba(17, 36, 58, 0.08);
}

.demo-credentials {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(247, 251, 253, 0.95), rgba(255, 255, 255, 0.9));
  margin: 18px 0;
}

.demo-credentials h3,
.panel h3,
.feature-card h2,
.auth-card h2,
.section-head h2 {
  font-size: 22px;
}

.auth-form,
.job-form {
  display: grid;
  gap: 14px;
}

.lang-pair-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.lang-pair-row select {
  flex: 1;
}

.lang-pair-row .danger-btn {
  padding: 4px 10px;
  font-size: 12px;
  flex: 0 0 auto;
}

.field-label {
  color: var(--muted);
  font-size: 14px;
  display: block;
  margin-bottom: 4px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--muted);
  font-size: 14px;
}

.field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--ink);
}

.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 36px 12px 14px;
  background: rgba(255, 255, 255, 0.98) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2361748b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
  color: var(--ink);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: rgba(12, 124, 109, 0.55);
  box-shadow: 0 0 0 4px rgba(12, 124, 109, 0.12);
}

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

.role-choice {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  font-weight: 700;
}

.role-choice input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.role-choice:has(input:checked) {
  border-color: rgba(12, 124, 109, 0.48);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.topbar h1 {
  font-size: clamp(28px, 4vw, 42px);
}

.dashboard-tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px;
  align-items: center;
}

.dashboard-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.dashboard-tab:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--line);
}

.dashboard-tab.is-active {
  background: linear-gradient(135deg, var(--accent), #1c9989);
  color: #fff;
  box-shadow: 0 12px 26px rgba(12, 124, 109, 0.18);
}

.tab-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  background: rgba(17, 36, 58, 0.08);
  font-size: 14px;
  font-weight: 800;
}

.dashboard-tab.is-active .tab-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.dashboard-panels {
  display: grid;
  gap: 18px;
}

.panel {
  min-height: 320px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.jobs-list,
.notifications-list,
.simple-list {
  display: grid;
  gap: 12px;
}

.data-table-shell {
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(248, 251, 253, 0.98), rgba(255, 255, 255, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.data-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(17, 36, 58, 0.08);
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(241, 247, 250, 0.96);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.data-table tbody tr:hover {
  background: rgba(12, 124, 109, 0.05);
}

.data-table tbody tr.new-job-row {
  background: linear-gradient(90deg, rgba(12, 124, 109, 0.14), rgba(12, 124, 109, 0.04));
}

.sort-btn {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  box-shadow: none;
}

.sort-btn:hover {
  background: transparent;
  color: var(--accent-strong);
  transform: none;
}

.table-primary {
  font-weight: 700;
}

.table-secondary,
.table-message {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.table-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(12, 124, 109, 0.1);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.preview-cell {
  width: 112px;
  position: relative;
}

.job-thumb {
  width: 84px;
  height: 112px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 10px 24px rgba(17, 36, 58, 0.08);
  position: relative;
  z-index: 1;
  cursor: zoom-in;
}

/* Expanded preview — absolutely positioned clone shown on hover */
.job-thumb-expanded {
  display: none;
  position: fixed;
  width: 300px;
  height: 400px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 20px 60px rgba(17, 36, 58, 0.3);
  z-index: 9999;
  pointer-events: none;
}

.job-thumb-expanded img,
.job-thumb-expanded iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  object-fit: contain;
}

.job-thumb-image,
.job-thumb-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fff;
  pointer-events: none;
}

.job-thumb-image {
  object-fit: contain;
}

.job-thumb-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #f8fbff, #edf5f7);
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.job-card,
.notification-card,
.simple-item {
  padding: 16px;
  background: linear-gradient(180deg, rgba(248, 251, 253, 0.95), rgba(255, 255, 255, 0.95));
}

.job-meta,
.notification-meta {
  font-size: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  background: #e2e8f0;
  color: #334155;
}

.pill.status-completed {
  background: #dcfce7;
  color: #166534;
}

.pill.status-claimed,
.pill.status-in_progress {
  background: #dbeafe;
  color: #1d4ed8;
}

.pill.status-submitted,
.pill.status-claim_expired {
  background: #fef3c7;
  color: #92400e;
}

.pill.status-pending_payment {
  background: #ede9fe;
  color: #5b21b6;
}

.status {
  min-height: 20px;
  margin-bottom: 0;
  color: var(--accent-strong);
}

.status.error {
  color: #b42318;
}

.drop-zone {
  border: 2px dashed rgba(12, 124, 109, 0.45);
  border-radius: 20px;
  min-height: 132px;
  display: grid;
  place-items: center;
  cursor: pointer;
  text-align: center;
  padding: 18px;
  color: #0f5c57;
  font-weight: 600;
  background: linear-gradient(180deg, rgba(240, 253, 250, 0.95), rgba(236, 253, 245, 0.62));
}

.drop-zone.is-dragover {
  border-color: var(--accent);
  background: #dff8f4;
}

.drop-zone input {
  display: none;
}

.upload-pages-panel {
  display: grid;
  gap: 14px;
}

.section-head.compact {
  margin-bottom: 0;
}

.section-head.compact h3 {
  margin: 0;
}

.upload-pages-list {
  display: flex;
  flex-direction: row;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 10px;
  align-items: flex-start;
}

.upload-page-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
  width: 220px;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  cursor: grab;
  user-select: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.upload-page-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(15, 92, 87, 0.12);
}

.upload-page-card.is-dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.upload-page-card.is-drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 92, 87, 0.2);
}

.upload-page-thumb {
  aspect-ratio: 0.707;
  border-radius: 8px;
  overflow: hidden;
  background: #edf5f3;
  border: 1px solid rgba(15, 92, 87, 0.1);
  width: 100%;
}

.upload-page-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.upload-page-meta {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.upload-page-meta strong,
.upload-page-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.upload-page-meta span {
  color: var(--muted);
}

.upload-page-actions {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  justify-content: center;
}

.upload-page-actions .secondary-btn,
.upload-page-actions .danger-btn {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 8px;
  flex: 1;
}

.job-progress-bar {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 2px 0 4px;
}

.job-progress-track {
  width: 100%;
  height: 6px;
  background: var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
}

.job-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.28s ease-out;
}

.job-progress-label {
  font-size: 13px;
  color: var(--muted);
}

.processing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #0f5c57;
  font-weight: 600;
}

.job-assign-select {
  min-width: 180px;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: inherit;
}

.danger-btn {
  background: #fff1f2;
  color: #b42318;
  border-color: rgba(180, 35, 24, 0.18);
}

.danger-btn:hover {
  background: #ffe4e6;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #a7f3d0;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.approve-user-btn {
  margin-top: 12px;
}

.app-layout.is-hidden,
.landing-shell.is-hidden,
.processing-indicator.is-hidden,
.is-hidden {
  display: none;
}

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

@media (max-width: 1180px) {
  .hero-grid,
  .admin-columns,
  .role-cards,
  .metrics-row {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    position: static;
  }
}

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

  .landing-nav,
  .topbar {
    flex-direction: column;
  }

  .role-choice-grid,
  .language-grid {
    grid-template-columns: 1fr;
  }

  .upload-pages-list {
    flex-wrap: wrap;
  }

  .upload-page-card {
    width: 160px;
  }

  .upload-page-actions {
    justify-content: flex-start;
  }

  .hero-copy h1 {
    max-width: 100%;
  }
}

/* ── Settings panel ──────────────────────────────────────────────────────────── */

.settings-sections {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 4px 0;
}

.settings-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
}

.settings-section--profile {
  flex-shrink: 0;
  width: 300px;
}

.settings-section--docs {
  flex-shrink: 0;
  width: 420px;
}

.settings-section--decl {
  flex: 1;
  min-width: 320px;
}

.settings-form {
  max-width: 100%;
}

.settings-section h3 {
  margin: 0 0 20px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.settings-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}

.settings-section h4 {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.settings-form {
  max-width: 480px;
}

.settings-name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 0;
}

#settings-translator-section .settings-divider {
  margin: 16px 0 12px;
}

#settings-translator-section h4 {
  margin: 0 0 10px;
}

.field-readonly {
  background: var(--bg);
  color: var(--muted);
  cursor: default;
  border-color: var(--line) !important;
}

.settings-docs-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.settings-doc-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-doc-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.settings-doc-link {
  font-size: 13px;
  color: var(--accent);
  text-decoration: underline;
}

.settings-doc-none {
  font-size: 13px;
  color: var(--muted);
}

.settings-doc-upload {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.settings-doc-upload .field {
  margin-bottom: 0;
}

.settings-auth-section {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.settings-auth-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.settings-auth-entry {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.settings-auth-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.settings-auth-entry-header a {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-auth-entry-header a:hover {
  text-decoration: underline;
}

.settings-auth-entry-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.settings-auth-entry-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-auth-entry-fields .field {
  margin-bottom: 0;
}

.settings-auth-entry-fields .field span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.settings-auth-pairs-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-auth-pairs-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.settings-auth-pairs-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-auth-entry-footer {
  display: flex;
  justify-content: flex-end;
  padding: 10px 14px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.settings-auth-add-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.settings-auth-add-form .field {
  margin-bottom: 0;
}

.settings-auth-delete-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  padding: 2px 6px;
  line-height: 1;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.settings-auth-delete-btn:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.settings-auth-save-btn {
  align-self: flex-start;
}

.decl-pair-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.decl-pair-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.decl-pair-select {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 32px 7px 12px;
  font-size: 13px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2361748b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--ink);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.decl-pair-select:focus {
  outline: none;
  border-color: rgba(12, 124, 109, 0.55);
  box-shadow: 0 0 0 4px rgba(12, 124, 109, 0.12);
}

.settings-declaration-hint {
  font-size: 12px;
  color: var(--muted);
  margin: -10px 0 14px;
}

.decl-formatting-toolbar {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 6px 0 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.decl-page-shell {
  background: #e0e4e8;
  border-radius: 8px;
  padding: 16px;
}

.decl-page-scroll {
  overflow: visible;
  display: flex;
  justify-content: center;
}

.decl-page {
  background: white;
  width: 210mm;
  padding: 12.7mm;
  box-shadow: 0 2px 16px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  /* zoom is set dynamically in JS to fit container width */
}

.decl-page-content {
  outline: none;
}

/* Toolbar shared styles (mirrors pdf-editor.css for use in settings) */
.decl-formatting-toolbar .tb-select {
  height: 30px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  outline: none;
}
.decl-formatting-toolbar .tb-select:focus { border-color: var(--accent); }
.decl-formatting-toolbar .tb-font-family { width: 110px; }
.decl-formatting-toolbar .tb-font-size  { width: 60px;  }
.decl-formatting-toolbar .tb-divider {
  width: 1px; height: 22px;
  background: var(--line);
  margin: 0 4px; flex-shrink: 0;
}
.decl-formatting-toolbar .tb-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; padding: 0 7px;
  border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--ink);
  font-size: 13px; font-weight: 400; cursor: pointer; line-height: 1;
  transition: background 0.1s, border-color 0.1s;
}
.decl-formatting-toolbar .tb-btn:hover { background: var(--bg); border-color: var(--line); }
.decl-formatting-toolbar .tb-btn.is-active { background: #def7f3; border-color: var(--accent); color: var(--accent-strong); }
.decl-formatting-toolbar .tb-btn svg { display: block; }
.decl-formatting-toolbar .tb-underline-btn { text-decoration: underline; }
.decl-formatting-toolbar .tb-strike-btn   { text-decoration: line-through; }
.decl-formatting-toolbar .tb-action-btn {
  font-size: 12px; font-weight: 600; padding: 0 10px;
  color: var(--accent-strong); border-color: var(--accent);
}
.decl-formatting-toolbar .tb-color-label {
  display: inline-flex; flex-direction: column; align-items: center;
  gap: 1px; padding: 3px 7px;
  border: 1px solid transparent; border-radius: 6px;
  cursor: pointer; position: relative; line-height: 1;
}
.decl-formatting-toolbar .tb-color-label:hover { background: var(--bg); border-color: var(--line); }
.decl-formatting-toolbar .tb-color-letter { font-size: 13px; font-weight: 700; color: var(--ink); display: block; }
.decl-formatting-toolbar .tb-color-bar   { display: block; width: 18px; height: 4px; border-radius: 2px; }
.decl-formatting-toolbar .tb-color-label input[type="color"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; border: none; padding: 0;
}

.settings-doc-preview {
  margin: 6px 0 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.crop-wrapper {
  position: relative;
  display: inline-block;
  overflow: hidden;
  border-radius: 4px;
}

.crop-overlay {
  position: absolute;
  inset: 0;
  cursor: crosshair;
}

.crop-selection {
  position: absolute;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
  display: none;
  pointer-events: none;
}

.crop-row {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 11;
}

.crop-btn {
  font-size: 12px;
  padding: 3px 10px;
}

.crop-actions {
  display: flex;
  gap: 6px;
}

.crop-actions .secondary-btn {
  font-size: 12px;
  padding: 3px 10px;
}

.settings-doc-img {
  max-width: 220px;
  max-height: 140px;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-box {
  background: #fff;
  border-radius: 10px;
  padding: 32px 36px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
}

.modal-body {
  color: #444;
  margin-bottom: 16px;
}

.payment-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 14px;
}

.payment-summary-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #f0f0f0;
}

.payment-summary-table td:first-child {
  color: #888;
  width: 140px;
}

.modal-note {
  font-size: 12px;
  color: #888;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.payment-multilang-note {
  display: block;
  font-size: 12px;
  color: var(--gold);
  padding: 4px 0 2px;
}

.payment-lang-select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 30px 6px 10px;
  background: rgba(255,255,255,0.98) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2361748b' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--ink);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font-size: 14px;
}

.payment-lang-select:focus {
  outline: none;
  border-color: rgba(12, 124, 109, 0.55);
  box-shadow: 0 0 0 3px rgba(12, 124, 109, 0.12);
}

.payment-assign-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 4px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.payment-assign-row--disabled {
  opacity: 0.45;
}

.payment-assign-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.payment-assign-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.payment-assign-sub {
  font-size: 12px;
  color: var(--muted);
}

.pill-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.pill-toggle--disabled {
  cursor: not-allowed;
}

.pill-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.pill-toggle-track {
  position: absolute;
  inset: 0;
  background: var(--line-strong);
  border-radius: 999px;
  transition: background 0.2s;
}

.pill-toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  transition: transform 0.2s;
}

.pill-toggle input:checked + .pill-toggle-track {
  background: var(--accent);
}

.pill-toggle input:checked + .pill-toggle-track::after {
  transform: translateX(20px);
}
