/* Shared presentation for the standalone Global Tools pages. */

:root {
  --gt-bg: #07111f;
  --gt-bg-soft: #0c1a2c;
  --gt-panel: rgba(15, 31, 51, 0.88);
  --gt-panel-strong: #10233a;
  --gt-line: rgba(148, 163, 184, 0.2);
  --gt-line-strong: rgba(148, 163, 184, 0.34);
  --gt-text: #f8fafc;
  --gt-muted: #a5b4c7;
  --gt-subtle: #718198;
  --gt-accent: #38bdf8;
  --gt-accent-strong: #0ea5e9;
  --gt-accent-soft: rgba(56, 189, 248, 0.13);
  --gt-success: #34d399;
  --gt-success-soft: rgba(52, 211, 153, 0.13);
  --gt-warning: #fbbf24;
  --gt-warning-soft: rgba(251, 191, 36, 0.13);
  --gt-danger: #fb7185;
  --gt-danger-soft: rgba(251, 113, 133, 0.13);
  --gt-radius: 18px;
  --gt-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--gt-bg);
}

body.global-tool-page {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--gt-text);
  background:
    radial-gradient(
      circle at 9% 0%,
      rgba(14, 165, 233, 0.16),
      transparent 34rem
    ),
    radial-gradient(
      circle at 92% 15%,
      rgba(129, 140, 248, 0.13),
      transparent 31rem
    ),
    var(--gt-bg);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

button,
label,
select {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.gt-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(7, 17, 31, 0.88);
  backdrop-filter: blur(18px);
}

.gt-header-inner,
.gt-main,
.gt-footer-inner {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.gt-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 20px;
}

.gt-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
  color: var(--gt-text);
  text-decoration: none;
}

.gt-brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  color: #dff6ff;
  background: linear-gradient(
    145deg,
    rgba(14, 165, 233, 0.34),
    rgba(99, 102, 241, 0.24)
  );
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.14);
}

.gt-brand-copy {
  min-width: 0;
}

.gt-brand-name {
  display: block;
  overflow: hidden;
  color: #f8fafc;
  font-size: 0.98rem;
  font-weight: 740;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gt-brand-kicker {
  display: block;
  margin-top: -2px;
  color: var(--gt-subtle);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.gt-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--gt-muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

.gt-nav a,
.gt-footer a,
.gt-language-link {
  text-decoration: none;
  transition: color 160ms ease;
}

.gt-nav a:hover,
.gt-nav a:focus-visible,
.gt-footer a:hover,
.gt-footer a:focus-visible,
.gt-language-link:hover,
.gt-language-link:focus-visible {
  color: var(--gt-accent);
}

.gt-language-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid var(--gt-line);
  border-radius: 999px;
  color: var(--gt-text);
  background: rgba(15, 31, 51, 0.65);
}

.gt-main {
  padding: 52px 0 72px;
}

.gt-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: 24px;
}

.gt-content {
  min-width: 0;
}

.gt-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 13px;
  color: var(--gt-accent);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gt-eyebrow::before {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 5px var(--gt-accent-soft);
  content: "";
}

.gt-title {
  max-width: 760px;
  margin: 0;
  color: var(--gt-text);
  font-size: clamp(2rem, 4.2vw, 3.6rem);
  font-weight: 790;
  letter-spacing: -0.055em;
  line-height: 1.09;
  word-break: keep-all;
}

.gt-lead {
  max-width: 720px;
  margin: 19px 0 0;
  color: var(--gt-muted);
  font-size: 1.06rem;
  line-height: 1.75;
}

.gt-lead strong {
  color: var(--gt-text);
  font-weight: 690;
}

.gt-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0 0;
}

.gt-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 11px;
  border: 1px solid var(--gt-line);
  border-radius: 999px;
  color: var(--gt-muted);
  background: rgba(15, 31, 51, 0.64);
  font-size: 0.78rem;
  font-weight: 650;
  flex-shrink: 0;
  white-space: nowrap;
}

.gt-pill-success {
  border-color: rgba(52, 211, 153, 0.28);
  color: #a7f3d0;
  background: var(--gt-success-soft);
}

.gt-card {
  border: 1px solid var(--gt-line);
  border-radius: var(--gt-radius);
  background: var(--gt-panel);
  box-shadow: var(--gt-shadow);
}

.gt-tool-card {
  margin-top: 31px;
  padding: clamp(20px, 4vw, 32px);
}

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

.gt-card-title {
  margin: 0;
  color: var(--gt-text);
  font-size: 1.2rem;
  font-weight: 730;
  letter-spacing: -0.025em;
}

.gt-card-subtitle {
  margin: 4px 0 0;
  color: var(--gt-subtle);
  font-size: 0.86rem;
}

.gt-upload-zone {
  display: block;
  padding: clamp(25px, 6vw, 48px) 22px;
  border: 1px dashed rgba(56, 189, 248, 0.52);
  border-radius: 15px;
  color: var(--gt-muted);
  background: linear-gradient(
    145deg,
    rgba(14, 165, 233, 0.09),
    rgba(15, 31, 51, 0.42)
  );
  cursor: pointer;
  text-align: center;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.gt-upload-zone:hover,
.gt-upload-zone:focus-within,
.gt-upload-zone.is-dragging {
  border-color: var(--gt-accent);
  background: linear-gradient(
    145deg,
    rgba(14, 165, 233, 0.17),
    rgba(15, 31, 51, 0.54)
  );
}

.gt-upload-zone.is-dragging {
  transform: translateY(-2px);
}

.gt-upload-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 13px;
  place-items: center;
  border: 1px solid rgba(56, 189, 248, 0.26);
  border-radius: 15px;
  color: #d8f4ff;
  background: var(--gt-accent-soft);
}

.gt-upload-title {
  margin: 0;
  color: var(--gt-text);
  font-size: 1rem;
  font-weight: 700;
}

.gt-upload-help {
  margin: 5px 0 0;
  color: var(--gt-subtle);
  font-size: 0.83rem;
}

.gt-ocr-preview {
  display: grid;
  min-height: 150px;
  margin-top: 18px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--gt-line);
  border-radius: 13px;
  background: rgba(2, 6, 23, 0.42);
}

.gt-ocr-preview[hidden] {
  display: none;
}

.gt-ocr-preview img {
  max-height: 340px;
  object-fit: contain;
}

.gt-ocr-result {
  display: block;
  width: 100%;
  min-height: 240px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--gt-line);
  border-radius: 12px;
  color: var(--gt-text);
  background: rgba(2, 6, 23, 0.5);
  line-height: 1.65;
  resize: vertical;
}

.gt-ocr-result:focus {
  outline: 2px solid var(--gt-accent);
  outline-offset: 2px;
}

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

.gt-status {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--gt-muted);
  font-size: 0.86rem;
}

.gt-status[data-tone="success"] {
  color: #a7f3d0;
}

.gt-status[data-tone="error"] {
  color: #fecdd3;
}

.gt-status[data-tone="warning"] {
  color: #fde68a;
}

.gt-pdf-progress {
  display: block;
  width: 100%;
  height: 10px;
  margin-top: 16px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  color: var(--gt-accent);
  background: rgba(148, 163, 184, 0.16);
}

.gt-pdf-progress::-webkit-progress-bar {
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
}

.gt-pdf-progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, #7dd3fc, #38bdf8);
}

.gt-pdf-progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, #7dd3fc, #38bdf8);
}

.gt-file-list {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}

.gt-file-list[hidden] {
  display: none;
}

.gt-list-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--gt-muted);
  font-size: 0.82rem;
  font-weight: 680;
}

.gt-text-button {
  padding: 0;
  border: 0;
  color: var(--gt-subtle);
  background: transparent;
  cursor: pointer;
  font-size: 0.78rem;
}

.gt-text-button:hover,
.gt-text-button:focus-visible {
  color: var(--gt-danger);
}

.gt-file-row {
  display: grid;
  grid-template-columns: auto 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 13px;
  background: rgba(7, 17, 31, 0.52);
}

.gt-file-row.is-dragging {
  border-color: var(--gt-accent);
  opacity: 0.58;
}

.gt-drag-handle {
  color: var(--gt-subtle);
  cursor: grab;
  font-size: 1.05rem;
  line-height: 1;
  user-select: none;
}

.gt-drag-handle:active {
  cursor: grabbing;
}

.gt-file-preview {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 9px;
  background: var(--gt-bg-soft);
  object-fit: cover;
}

.gt-file-meta {
  min-width: 0;
}

.gt-file-name {
  overflow: hidden;
  color: var(--gt-text);
  font-size: 0.87rem;
  font-weight: 630;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gt-file-detail {
  overflow: hidden;
  margin-top: 2px;
  color: var(--gt-subtle);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gt-file-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.gt-icon-button {
  display: inline-grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid var(--gt-line);
  border-radius: 8px;
  color: var(--gt-muted);
  background: rgba(15, 31, 51, 0.72);
  cursor: pointer;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.gt-icon-button:hover,
.gt-icon-button:focus-visible {
  border-color: var(--gt-accent);
  color: var(--gt-text);
  background: var(--gt-accent-soft);
}

.gt-icon-button-danger:hover,
.gt-icon-button-danger:focus-visible {
  border-color: var(--gt-danger);
  color: #fecdd3;
  background: var(--gt-danger-soft);
}

.gt-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin-top: 23px;
}

.gt-field {
  display: grid;
  gap: 7px;
  color: var(--gt-muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.gt-field-wide {
  grid-column: 1 / -1;
}

.gt-field input,
.gt-field select,
.gt-field textarea {
  width: 100%;
  border: 1px solid var(--gt-line-strong);
  border-radius: 10px;
  color: var(--gt-text);
  background: rgba(7, 17, 31, 0.7);
  outline: 0;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.gt-field input {
  min-height: 44px;
  padding: 0 12px;
  color-scheme: dark;
}

.gt-field select {
  min-height: 44px;
  padding: 0 12px;
}

.gt-field textarea {
  min-height: 230px;
  padding: 15px;
  resize: vertical;
}

.gt-field input:focus,
.gt-field select:focus,
.gt-field textarea:focus {
  border-color: var(--gt-accent);
  box-shadow: 0 0 0 3px var(--gt-accent-soft);
}

.gt-action-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 23px;
}

.gt-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 0.9rem;
  font-weight: 750;
  cursor: pointer;
  transition:
    filter 160ms ease,
    transform 160ms ease,
    opacity 160ms ease;
}

.gt-button:hover:not(:disabled),
.gt-button:focus-visible:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.gt-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.gt-button-primary {
  color: #02111d;
  background: linear-gradient(135deg, #7dd3fc, #38bdf8);
  box-shadow: 0 10px 24px rgba(14, 165, 233, 0.2);
}

.gt-button-secondary {
  border-color: var(--gt-line-strong);
  color: var(--gt-text);
  background: rgba(15, 31, 51, 0.72);
}

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

.gt-helper {
  margin: 14px 0 0;
  color: var(--gt-subtle);
  font-size: 0.77rem;
  line-height: 1.55;
}

.gt-side {
  display: grid;
  gap: 16px;
}

.gt-side-card {
  padding: 21px;
}

.gt-side-title {
  margin: 0 0 11px;
  color: var(--gt-text);
  font-size: 0.98rem;
  font-weight: 720;
}

.gt-side-card p,
.gt-side-card li {
  color: var(--gt-muted);
  font-size: 0.84rem;
  line-height: 1.7;
}

.gt-side-card p {
  margin: 0;
}

.gt-side-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.gt-side-card li::marker {
  color: var(--gt-accent);
}

.gt-side-note {
  border-color: rgba(251, 191, 36, 0.26);
  background: linear-gradient(
    145deg,
    rgba(251, 191, 36, 0.09),
    rgba(15, 31, 51, 0.82)
  );
}

.gt-side-note .gt-side-title {
  color: #fde68a;
}

.gt-counter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.gt-stat {
  min-width: 0;
  padding: 14px 13px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  background: rgba(7, 17, 31, 0.54);
}

.gt-stat-label {
  display: block;
  overflow: hidden;
  color: var(--gt-subtle);
  font-size: 0.72rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gt-stat-value {
  display: block;
  margin-top: 4px;
  color: var(--gt-text);
  font-variant-numeric: tabular-nums;
  font-size: 1.42rem;
  font-weight: 760;
  letter-spacing: -0.035em;
}

.gt-result-stat {
  margin-top: 22px;
}

.gt-info-section {
  margin-top: 58px;
}

.gt-section-title {
  margin: 0 0 15px;
  color: var(--gt-text);
  font-size: 1.35rem;
  font-weight: 740;
  letter-spacing: -0.03em;
}

.gt-faq {
  display: grid;
  gap: 9px;
}

.gt-faq details {
  border: 1px solid var(--gt-line);
  border-radius: 12px;
  background: rgba(15, 31, 51, 0.6);
}

.gt-faq summary {
  padding: 15px 17px;
  color: var(--gt-text);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 680;
  list-style-position: inside;
}

.gt-faq details p {
  margin: -2px 17px 16px 35px;
  color: var(--gt-muted);
  font-size: 0.84rem;
  line-height: 1.7;
}

.gt-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  color: var(--gt-subtle);
}

.gt-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 92px;
  font-size: 0.8rem;
}

.gt-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.gt-footer a {
  color: var(--gt-muted);
}

.gt-empty-state {
  padding: 24px;
  border: 1px dashed var(--gt-line);
  border-radius: 12px;
  color: var(--gt-subtle);
  font-size: 0.84rem;
  text-align: center;
}

@media (max-width: 900px) {
  .gt-layout {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (max-width: 640px) {
  .gt-header-inner,
  .gt-main,
  .gt-footer-inner {
    width: min(100% - 24px, 1120px);
  }

  .gt-header-inner {
    min-height: 64px;
  }

  .gt-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .gt-brand-name {
    font-size: 0.9rem;
  }

  .gt-brand-kicker {
    font-size: 0.6rem;
  }

  .gt-nav {
    gap: 8px;
    font-size: 0.78rem;
  }

  .gt-nav-home {
    display: none;
  }

  .gt-main {
    padding: 37px 0 54px;
  }

  .gt-title {
    font-size: clamp(1.9rem, 10vw, 2.7rem);
  }

  .gt-lead {
    font-size: 0.96rem;
  }

  .gt-tool-card {
    margin-top: 25px;
    padding: 17px;
  }

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

  .gt-field-wide {
    grid-column: auto;
  }

  .gt-file-row {
    grid-template-columns: auto 38px minmax(0, 1fr);
  }

  .gt-file-preview {
    width: 38px;
    height: 38px;
  }

  .gt-file-actions {
    grid-column: 2 / -1;
    justify-content: flex-end;
    margin-top: -3px;
  }

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

  .gt-counter-grid .gt-stat:last-child {
    grid-column: 1 / -1;
  }

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

  .gt-footer-inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 22px 0;
  }
}

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

html[data-game-embed="true"] body.global-tool-page {
  min-width: 0;
  min-height: 0;
  background: var(--gt-bg);
}

html[data-game-embed="true"] .gt-header,
html[data-game-embed="true"] .gt-footer,
html[data-game-embed="true"] .quokka-footer,
html[data-game-embed="true"] .quokka-ad,
html[data-game-embed="true"] .quokka-side-ads,
html[data-game-embed="true"] .gt-side,
html[data-game-embed="true"] .gt-content > :not(.gt-tool-card) {
  display: none !important;
}

html[data-game-embed="true"] .gt-main,
html[data-game-embed="true"] .gt-main > .gt-layout {
  display: block;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

html[data-game-embed="true"] .gt-content {
  width: 100%;
  max-width: none;
  margin: 0;
}

html[data-game-embed="true"] .gt-tool-card {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
