/* Styles ausgelagert aus index.html */

  :root {
      --bg: #020617;
      --bg-strong: #020617;
      --card-bg: rgba(15, 23, 42, 0.45);
      --accent: #0f766e; /* dezentes Petrol */
      --accent-soft: rgba(15, 118, 110, 0.20);
      --accent-strong: #14b8a6;
      --text-main: #e5e7eb;
      --text-sub: #9ca3af;
      --btn-bg: rgba(15, 23, 42, 0.9);
      --btn-bg-hover: rgba(15, 118, 110, 0.95);
      --border-soft: rgba(148, 163, 184, 0.5);
      --surface-elevated: rgba(15, 23, 42, 0.96);
      --danger: #f97373;
      --danger-soft: rgba(248, 113, 113, 0.12);
      --success: #0f766e;
      --success-soft: rgba(15, 118, 110, 0.22);
      --muted: #6b7280;
    }

    html {
      scroll-behavior: smooth;
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      padding: 0;
      background:
        radial-gradient(circle at top, rgba(148, 163, 184, 0.14), transparent 58%),
        radial-gradient(circle at bottom, rgba(15, 23, 42, 0.7), transparent 68%),
        radial-gradient(circle at top, #1f2937 0, #111827 40%, #020617 78%, #000 100%);
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
      color: var(--text-main);
      display: flex;
      justify-content: center;
      position: relative;
      -webkit-font-smoothing: antialiased;
    }

    body::before {
      content: "";
      position: absolute;
      inset: 0;
      z-index: -1;
      background:
        /* weiche Lichtinseln links/rechts oben, nun neutral-grau statt blau */
        radial-gradient(circle at 15% -10%, rgba(148, 163, 184, 0.30), transparent 55%),
        radial-gradient(circle at 85% -15%, rgba(148, 163, 184, 0.18), transparent 55%),
        /* leicht dunklere Zone unten für Tiefe */
        radial-gradient(circle at 50% 115%, rgba(15, 23, 42, 0.85), transparent 60%),
        /* dezente diagonale Struktur */
        linear-gradient(135deg, rgba(15, 23, 42, 0.70), rgba(2, 6, 23, 0.95));
      background-size:
        100% 100%,
        100% 100%,
        100% 100%,
        100% 100%;
      opacity: 0.98;
      filter: none;
      animation: none;
    }

    @keyframes bg-glow-shift {
      0% {
        background-position:
          0% 0%,
          100% 100%,
          50% 40%;
      }
      50% {
        background-position:
          24% 16%,
          76% 84%,
          50% 46%;
      }
      100% {
        background-position:
          8% 22%,
          92% 78%,
          50% 34%;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      body::before {
        animation: none;
      }
    }

    main,
    .page-hero,
    .converter-box,
    .quiz-box,
    .image-tile-card,
    .image-tile-card-secondary,
    .image-tile-card-tertiary,
    .credits-section,
    .calculator-wrapper {
      max-width: 760px;
      margin: 0 auto;
    }

    /* Subtle global transitions for a modern, calm motion system */
    a,
    button {
      transition:
        color 160ms ease-out,
        background-color 160ms ease-out,
        border-color 160ms ease-out,
        box-shadow 160ms ease-out,
        transform 160ms ease-out;
    }

    .calculator,
    .converter-box,
    .quiz-box,
    .credits-section {
      transition:
        box-shadow 180ms ease-out,
        transform 180ms ease-out,
        border-color 180ms ease-out,
        background 260ms ease-out;
    }

    .calculator:hover,
    .converter-box:hover,
    .quiz-box:hover,
    .credits-section:hover {
      transform: translateY(-1px);
    }

    /* Subtle load-in animation for main UI elements */
    @keyframes card-fade-up {
      from {
        opacity: 0;
        transform: translateY(8px) scale(0.985);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    /* Global focus styles for accessibility & premium feel */
    a:focus-visible,
    button:focus-visible,
    input:focus-visible,
    select:focus-visible,
    textarea:focus-visible {
      outline: 2px solid rgba(20, 184, 166, 0.95);
      border-color: rgba(45, 212, 191, 0.9);
      outline-offset: 2px;
    }

    .page {
      max-width: 960px;
      width: 100%;
      padding: 0 18px 34px;
      display: flex;
      flex-direction: column;
      min-height: 100vh;
      gap: 16px;
      position: relative;
      z-index: 0;
      padding-bottom: 96px; /* Platz für fixen Cookie-Banner, damit Inhalt darüber gescrollt werden kann */
    }

    .page::before,
    .page::after {
      content: none;
    }

    .top-bar {
      width: 100%;
      margin: 0 auto 11px;
      padding: 0;
      position: sticky;
      top: 0;
      z-index: 20;
    }

    .top-bar-inner {
      max-width: 760px;
      margin: 0 auto;
      padding: 10px 18px;
      border-radius: 0 0 18px 18px;
      background:
        radial-gradient(circle at 0% 0%, rgba(148, 163, 184, 0.10), transparent 55%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.82), rgba(15, 23, 42, 0.88));
      box-shadow: 0 8px 18px rgba(15, 23, 42, 0.40);
      border-bottom: 1px solid rgba(148, 163, 184, 0.30);
      backdrop-filter: blur(26px);
      -webkit-backdrop-filter: blur(26px);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .top-bar-titles {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .top-bar-title {
      font-size: 17px;
      font-weight: 650;
      letter-spacing: 0.05em;
      text-transform: uppercase;
      color: #e5e7eb;
      margin: 0;
    }

    .top-bar-subtitle {
      font-size: 13px;
      color: var(--text-sub);
      margin: 0;
    }

    .top-bar-subline {
      font-size: 12px;
      color: var(--text-sub);
      margin: 2px 0 0;
      font-weight: 500;
    }

    .page-hero {
      width: 100%;
      max-width: 760px; /* gleiche Breite wie Header/Kacheln */
      margin: 5px auto 5px;
      padding: 8px 4px 6px;
      text-align: center;
      border-radius: 0;
      position: relative;
      overflow: visible;
      background: transparent;
      box-shadow: none;
      border: none;
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
      animation: none;
    }

    .page-hero::before {
      content: none;
    }

    .page-hero h2 {
      margin: 0 0 10px;
      font-size: 16px;
      line-height: 1.7;
      font-weight: 500;
      color: rgba(209, 213, 219, 0.96);
    }

    .page-hero h3 {
      margin: 0 0 10px;
      font-size: 14px;
      line-height: 1.5;
      font-weight: 500;
      color: var(--text-sub);
    }

    .keyword-badges {
      margin: 2px 0 4px;
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      justify-content: center;
      align-items: center;
    }

    .keyword-badges.module-nav {
      justify-content: flex-start;
      align-items: flex-start;
    }

    .calculator-wrapper {
      width: 100%;
      margin: 5px auto 11px;
    }

    .calculator {
      background:
        radial-gradient(circle at 0% 0%, rgba(148, 163, 184, 0.12), transparent 55%),
        linear-gradient(135deg, rgba(17, 24, 39, 0.86), rgba(15, 23, 42, 0.92));
      padding: 18px 18px 19px; /* gleiche horizontale Breite wie converter/quiz */
      border-radius: 20px;
      box-shadow:
        0 8px 20px rgba(15, 23, 42, 0.42);
      border: 1px solid rgba(148, 163, 184, 0.28);
      width: 100%;
      max-width: none;
      margin: 0;
      backdrop-filter: blur(32px);
      -webkit-backdrop-filter: blur(32px);
      box-sizing: border-box;
      animation: card-fade-up 360ms ease-out both;
    }

    /* Hero & heading adjustments for narrow viewports */
    @media (max-width: 640px) {
      .top-bar-inner {
        padding: 8px 12px;
      }

      .top-bar-title {
        font-size: 15px;
        letter-spacing: 0.04em;
      }

      .top-bar-subtitle {
        font-size: 12px;
      }

      .top-bar-subline {
        display: none;
      }

      .page-hero {
        margin: 0 auto 10px;
        padding: 6px 6px 4px;
      }

      .page-hero h2 {
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 6px;
      }

      .keyword-badges {
        gap: 4px;
      }

      /* On small screens, keep header images inside the card width */
      .converter-box > .image-tile-media,
      .converter-box > .image-tile-media-secondary,
      .quiz-box > .image-tile-media,
      main > .image-tile-media-tertiary {
        margin: 0 0 10px;
        border-radius: 16px;
      }
    }

    .header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 10px;
      min-height: 40px;
      border-bottom: 1px solid rgba(148, 163, 184, 0.28);
      padding-bottom: 4px;
    }

    .header-left {
      max-width: 240px;
      display: flex;
      flex-direction: column;
      gap: 3px;
    }

    .title {
      font-size: 14px;
      text-transform: uppercase;
      letter-spacing: 0.12em;
      color: var(--text-sub);
      white-space: normal;
      line-height: 1.4;
    }

    .calculator .header .title {
      font-size: 19px;
      color: #f9fafb;
      letter-spacing: 0.06em;
    }

    .badge {
      font-size: 12px;
      padding: 3px 11px;
      border-radius: 10px;
      background: linear-gradient(135deg, #0f172a, #020617);
      color: #e5e7eb;
      border: 1px solid rgba(148, 163, 184, 0.6);
      max-width: fit-content;
      box-shadow: 0 2px 6px rgba(15, 23, 42, 0.40);
    }

    /* Language switch */
    .lang-switch {
      border: 1px solid rgba(45, 212, 191, 0.9);
      background: linear-gradient(135deg, var(--accent-strong), var(--accent));
      padding: 6px 14px;
      border-radius: 999px;
      font-size: 11px;
      cursor: pointer;
      font-weight: 700;
      min-width: 72px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
      color: #0b1120;
      box-shadow:
        0 6px 16px rgba(15, 23, 42, 0.85),
        0 0 0 1px rgba(15, 23, 42, 0.6);
      transition: background 0.14s ease, transform 0.08s ease, box-shadow 0.18s ease, border-color 0.16s ease;
    }

    .lang-switch:hover {
      background: linear-gradient(135deg, #14b8a6, #0f766e);
      transform: translateY(-1px);
      box-shadow:
        0 8px 20px rgba(15, 23, 42, 0.9),
        0 0 0 1px rgba(15, 23, 42, 0.7);
    }

    .lang-switch span {
      opacity: 0.9;
      color: #f9fafb;
    }
    .lang-switch span.active {
      opacity: 1;
      color: #f9fafb;
    }
    .lang-switch .divider { opacity: 0.9; }

    .display-field-wrapper {
      position: relative;
      margin-bottom: 4px;
    }

    #display {
      background: linear-gradient(135deg, #020617, #020617);
      color: #f9fafb;
      padding: 14px 12px 12px;
      font-size: 28px;
      text-align: right;
      border-radius: 14px;
      min-height: 44px;
      font-weight: 600;
      line-height: 34px;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
      box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.9), 0 8px 18px rgba(15, 23, 42, 0.75);
    }

    span.over {
      display: inline-block;
      border-top: 1px solid currentColor;
      padding-top: 1px;
    }

    #arabic-display {
      background: rgba(15, 23, 42, 0.9);
      color: var(--accent-strong);
      padding: 9px 11px;
      font-size: 17px;
      text-align: right;
      border-radius: 10px;
      margin-top: 8px;
      margin-bottom: 0;
      min-height: 30px;
      border: 1px solid rgba(45, 212, 191, 0.65);
      font-weight: 500;
      backdrop-filter: blur(14px);
    }

    .field-label {
      position: absolute;
      left: 10px;
      top: 4px;
      font-size: 10px;
      font-weight: 500;
      pointer-events: none;
    }

    .display-field-wrapper-roman .field-label {
      color: rgba(248, 250, 252, 0.86);
    }

    .display-field-wrapper-arabic .field-label {
      color: rgba(148, 163, 184, 0.9);
    }

    #steps-display {
      font-size: 11px;
      color: var(--text-main);
      text-align: right;
      min-height: 16px;
      margin-bottom: 6px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      line-height: 1.5;
    }

    .buttons {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 8px;
    }

    /* Basisstil nur für die Tasten im Rechner */
    .calculator .buttons button {
      padding: 12px 10px;
      font-size: 17px;
      border-radius: 10px;
      background: linear-gradient(135deg, #111827, #020617);
      cursor: pointer;
      transition: background 0.12s ease, transform 0.06s ease, box-shadow 0.16s ease, border-color 0.16s ease;
      font-weight: 600;
      color: var(--text-main);
      border: 1px solid rgba(148, 163, 184, 0.55);
      box-shadow: 0 3px 7px rgba(15, 23, 42, 0.40);
    }

    .calculator .buttons button:hover {
      background: linear-gradient(135deg, #1a2433, #020617);
      transform: translateY(-1px);
      box-shadow: 0 4px 9px rgba(15, 23, 42, 0.48);
    }

    .calculator .buttons button:active {
      transform: translateY(0) scale(0.985);
      box-shadow: 0 2px 5px rgba(15, 23, 42, 0.45);
    }

    .calculator .buttons button.operator {
      background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 1));
      color: #e5e7eb;
      border-color: rgba(20, 184, 166, 0.55);
      box-shadow: 0 3px 8px rgba(15, 23, 42, 0.55);
    }

    .calculator .buttons button.operator:hover {
      background: linear-gradient(135deg, rgba(20, 184, 166, 0.22), rgba(15, 23, 42, 0.98));
      border-color: rgba(45, 212, 191, 0.75);
      box-shadow: 0 4px 10px rgba(15, 23, 42, 0.65);
    }

    .calculator .buttons #equals {
      grid-column: span 4;
      background: linear-gradient(135deg, rgba(20, 184, 166, 0.96), rgba(15, 118, 110, 0.96));
      color: #eef2ff;
      font-size: 20px;
      border-radius: 12px;
      border-color: rgba(45, 212, 191, 0.85);
      box-shadow:
        0 6px 18px rgba(13, 148, 136, 0.65),
        0 0 0 1px rgba(45, 212, 191, 0.55);
      backdrop-filter: blur(18px);
      -webkit-backdrop-filter: blur(18px);
    }

    .calculator .buttons #equals:hover {
      background: linear-gradient(135deg, #14b8a6, #0f766e);
      box-shadow:
        0 8px 22px rgba(13, 148, 136, 0.80),
        0 0 0 1px rgba(45, 212, 191, 0.70);
      transform: translateY(-1px);
    }

    .calculator .buttons #clear {
      background: linear-gradient(135deg, #7f1d1d, #111827);
      color: #fecaca;
      border-color: rgba(248, 113, 113, 0.7);
    }

    .calculator .buttons #clear:hover {
      background: linear-gradient(135deg, #b91c1c, #111827);
    }

    .calculator .buttons #backspace {
      background: linear-gradient(135deg, #111827, #020617);
      color: #e5e7eb;
      border-color: rgba(148, 163, 184, 0.8);
    }

    .calculator .buttons #backspace:hover {
      background: linear-gradient(135deg, #1f2937, #020617);
    }

    .btn-small-label {
      display: block;
      font-size: 10px;
      opacity: 0.7;
      font-weight: 500;
    }

    /* CONTENT AREA */
    main {
      width: 100%;
      margin: 0 auto 20px;
      flex: 1 0 auto;
      padding: 0;
      background: transparent;
      border-radius: 0;
      box-shadow: none;
      border: none;
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
      animation: none;
    }

    /* Make the SEO header image sit flush with the main card (same behavior as converter/quiz) */
    main > .image-tile-media-tertiary {
      margin: -18px -18px 14px;
      border-radius: 20px 20px 0 0;
    }

    main h1 {
      font-size: 30px;
      margin: 4px 0 14px;
      letter-spacing: 0.02em;
    }

    main h2 {
      font-size: 22px;
      margin-top: 28px;
      margin-bottom: 6px;
    }

    .content-lang h2:first-of-type {
      margin-top: 0;
    }

    main h3 {
      font-size: 17px;
      margin-top: 18px;
      margin-bottom: 6px;
    }

    main p {
      font-size: 15px;
      line-height: 1.75;
      margin: 4px 0 12px;
      color: #d1d5db;
    }

    main ul {
      font-size: 14px;
      margin: 6px 0 12px 18px;
      padding-left: 0;
    }

    main li { margin-bottom: 4px; }

    table {
      border-collapse: collapse;
      margin: 8px 0 16px;
      font-size: 14px;
    }

    table th, table td {
      border: 1px solid var(--border-soft);
      padding: 4px 8px;
      text-align: left;
    }

    table th { background: rgba(15, 23, 42, 0.96); }

    .content-lang { margin-top: 8px; }
    .content-lang.hidden { display: none; }

    .content-lang p,
    .content-lang ul {
      max-width: 72ch;
    }

    .content-lang h2 {
      font-size: 20px;
      margin-top: 24px;
      margin-bottom: 8px;
    }

    .content-lang h3 {
      font-size: 16px;
      margin-top: 16px;
      margin-bottom: 6px;
    }

    .accordion-basics {
      margin-top: 10px;
    }

    .accordion-basics > summary {
      cursor: pointer;
      font-weight: 600;
      padding: 6px 0 6px 18px;
      list-style: none;
      position: relative;
    }

    .accordion-basics > summary::before {
      content: "▶";
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      font-size: 11px;
      color: var(--text-sub);
      transition: transform 140ms ease-out;
    }

    .accordion-basics[open] > summary {
      border-bottom: 1px solid rgba(148, 163, 184, 0.3);
      margin-bottom: 6px;
    }

    .accordion-basics[open] > summary::before {
      transform: translateY(-50%) rotate(90deg);
    }

    .note {
      font-size: 12px;
      color: var(--text-sub);
      margin-top: 10px;
    }

    .faq-section {
      border-top: 1px solid rgba(148, 163, 184, 0.35);
      padding-top: 16px;
      margin-top: 24px;
    }

    .faq-section > h2 {
      font-size: 19px;
      margin-top: 0;
      margin-bottom: 10px;
    }

    .faq-section > h3 {
      margin-top: 16px;
      margin-bottom: 4px;
    }

    .faq-section p {
      margin: 4px 0 10px;
    }

    .faq-section ul {
      margin-top: 4px;
      margin-bottom: 10px;
    }

    a {
      color: #f9fafb; /* globale Linkfarbe: fast Weiß */
      text-decoration: none;
    }

    a:hover {
      text-decoration: underline;
      color: var(--accent-strong);
    }

    .credits-section {
      margin-top: 20px;
      padding: 18px 18px 20px;
      border-radius: 20px;
      background:
        radial-gradient(circle at 0% 0%, rgba(148, 163, 184, 0.14), transparent 55%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.82), rgba(15, 23, 42, 0.90));
      box-shadow:
        0 6px 16px rgba(15, 23, 42, 0.32);
      border: 1px solid rgba(148, 163, 184, 0.26);
      backdrop-filter: blur(40px);
      -webkit-backdrop-filter: blur(40px);
      text-align: center;
    }

    .einmaleins-teaser {
      max-width: 760px;
      margin: 16px auto 0;
      padding: 14px 16px 16px;
      border-radius: 18px;
      background:
        radial-gradient(circle at 0% 0%, rgba(148, 163, 184, 0.10), transparent 55%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.90), rgba(15, 23, 42, 0.96));
      border: 1px solid rgba(148, 163, 184, 0.26);
      text-align: center;
      font-size: 14px;
      color: var(--text-sub);
    }

    .einmaleins-teaser h2 {
      font-size: 16px;
      margin: 0 0 6px;
      color: #e5e7eb;
    }

    .einmaleins-teaser p {
      margin: 0 0 10px;
    }

    .einmaleins-teaser-link {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 6px 14px;
      border-radius: 999px;
      border: 1px solid rgba(148, 163, 184, 0.6);
      background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 1));
      font-size: 13px;
      color: #e5e7eb;
      text-decoration: none;
      gap: 6px;
    }

    .einmaleins-teaser-link:hover {
      background: linear-gradient(135deg, rgba(15, 23, 42, 1), rgba(15, 23, 42, 1));
      color: var(--accent-strong);
      text-decoration: none;
    }

    /* Subtle hover elevation for main cards */
    .calculator,
    .converter-box,
    .quiz-box,
    .image-tile-card,
    .image-tile-card-secondary,
    .image-tile-card-tertiary,
    .credits-section {
      transition:
        transform 120ms ease-out,
        box-shadow 140ms ease-out,
        border-color 140ms ease-out;
    }

    .calculator:hover,
    .converter-box:hover,
    .quiz-box:hover,
    .image-tile-card:hover,
    .image-tile-card-secondary:hover,
    .image-tile-card-tertiary:hover,
    .credits-section:hover {
      transform: translateY(-1px);
      box-shadow:
        0 5px 12px rgba(15, 23, 42, 0.26);
    }

    .credits-title {
      font-size: 15px;
      font-weight: 600;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--text-sub);
      margin: 0 0 8px;
    }

    /* Scroll-based, subtle reveal animation for content sections below the hero */
    .reveal-on-scroll {
      opacity: 0;
      transform: translateY(18px) scale(0.985);
      transition:
        opacity 420ms ease-out,
        transform 420ms ease-out;
    }

    .reveal-on-scroll.reveal-visible {
      opacity: 1;
      transform: translateY(0) scale(1);
    }

    .credits-card {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 8px 0 0;
      margin-top: 4px;
      border-radius: 14px;
      background: none;
      border: none;
      box-shadow: none;
      width: 100%;
      max-width: none;
      text-align: center;
      margin-left: auto;
      margin-right: auto;
    }

    .credits-name {
      font-weight: 600;
      font-size: 15px;
      margin-bottom: 2px;
      text-align: center;
    }

    .credits-role {
      font-size: 13px;
      color: var(--text-sub);
    }

    /* Footer */
    footer {
      margin-top: 20px;
      margin-bottom: 0;
      padding-top: 12px;
      font-size: 12px;
      color: var(--text-main);
      text-align: center;
      flex-shrink: 0;
    }

    .seo-footer {
      margin: 20px 0 0;
      font-size: 11px;
      color: var(--text-sub);
      text-align: center;
    }

    footer a {
      color: var(--text-sub);
      text-decoration: none;
      margin: 0 6px;
    }

    footer a:hover {
      text-decoration: underline;
      color: var(--accent-strong);
    }

    .donation-qr {
      margin-top: 20px;
      text-align: center;
      max-width: 200px;
      margin-left: auto;
      margin-right: auto;
      padding: 12px;
      background: #ffffff;
      border-radius: 18px;
      box-shadow: 0 8px 18px rgba(15, 23, 42, 0.45);
      border: 1px solid rgba(148, 163, 184, 0.55);
      animation: card-fade-up 420ms ease-out 120ms both;
    }

    /* Cookie banner (bottom, glassy, in the style of header/cards) */
    .cookie-banner {
      position: fixed;
      left: 50%;
      transform: translateX(-50%);
      bottom: 0;
      width: 100%;
      max-width: 960px; /* wie .page */
      z-index: 40;
      display: none;
      padding: 0 18px 0; /* gleiche Seitenabstände wie .page */
      pointer-events: none;
    }

    .cookie-banner-inner {
      max-width: 760px;
      margin: 0 auto;
      border-radius: 14px 14px 0 0;
      background:
        radial-gradient(circle at 0% 0%, rgba(148, 163, 184, 0.12), transparent 60%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.88), rgba(15, 23, 42, 0.94));
      box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.75);
      border: 1px solid rgba(148, 163, 184, 0.40);
      backdrop-filter: blur(22px);
      -webkit-backdrop-filter: blur(22px);
      padding: 10px 14px 12px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      pointer-events: auto;
    }

    .cookie-banner-text {
      font-size: 12px;
      line-height: 1.6;
      color: var(--text-main);
    }

    .cookie-banner-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      justify-content: center;
    }

    .cookie-btn {
      padding: 6px 14px;
      border-radius: 999px;
      font-size: 11px;
      font-weight: 600;
      cursor: pointer;
      border: 1px solid rgba(148, 163, 184, 0.7);
      background: linear-gradient(135deg, #111827, #020617);
      color: #e5e7eb;
      box-shadow: 0 4px 10px rgba(15, 23, 42, 0.6);
      transition: background 0.14s ease, transform 0.08s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    }

    .cookie-btn.primary {
      border-color: rgba(45, 212, 191, 0.9);
      background: linear-gradient(135deg, var(--accent-strong), var(--accent));
      color: #0b1120;
      box-shadow:
        0 6px 14px rgba(15, 23, 42, 0.8),
        0 0 0 1px rgba(15, 23, 42, 0.7);
      padding-top: 11px;
      padding-bottom: 11px;
    }

    .cookie-btn:hover {
      transform: translateY(-1px);
      box-shadow: 0 6px 14px rgba(15, 23, 42, 0.7);
    }

    .cookie-btn.primary:hover {
      background: linear-gradient(135deg, #14b8a6, #0f766e);
      border-color: rgba(45, 212, 191, 0.95);
    }

    @media (max-width: 640px) {
      .cookie-banner-inner {
        min-height: 20vh;
        padding: 14px 14px 16px;
      }

      .cookie-banner-actions {
        flex-direction: column-reverse; /* primary (accept) oben */
        align-items: center;
        gap: 12px;
      }

      .cookie-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
      }

      .cookie-btn.primary {
        padding-top: 6px;
        padding-bottom: 6px;
      }
    }

    /* Converter */
    .converter-box {
      width: 100%;
      margin: 0 auto 20px;
      padding: 18px 18px 19px;
      background:
        radial-gradient(circle at 0% 0%, rgba(148, 163, 184, 0.10), transparent 55%),
        linear-gradient(135deg, rgba(17, 24, 39, 0.84), rgba(15, 23, 42, 0.90));
      border-radius: 20px;
      box-shadow:
        0 8px 20px rgba(15, 23, 42, 0.40);
      border: 1px solid rgba(148, 163, 184, 0.28);
      backdrop-filter: blur(32px);
      -webkit-backdrop-filter: blur(32px);
      animation: card-fade-up 380ms ease-out 40ms both;
    }

    .converter-box.has-header-image,
    .quiz-box.has-header-image {
      border-top-width: 0;
    }

    .converter-box h2 {
      font-size: 19px;
      margin: 0 0 6px;
    }

    .converter-desc {
      font-size: 13px;
      margin: 0 0 10px;
      color: var(--text-sub);
    }

    .converter-row {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 4px;
      margin-bottom: 10px;
    }

    .converter-label {
      font-size: 13px;
      color: var(--text-sub);
    }

    /* Converter inputs: wie Quiz-Eingabefeld (#quiz-answer) einzeilig und gleich groß */
    .converter-box input {
      flex: 1 1 120px;
      padding: 4px 8px;
      border-radius: 6px;
      border: 1px solid var(--border-soft);
      font-size: 13px;
      min-height: 28px;
      max-height: 40px;
      line-height: 1.3;
      box-sizing: border-box;
    }

    /* Remove default number arrows for a cleaner, flatter look */
    #convert-arabic::-webkit-outer-spin-button,
    #convert-arabic::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }

    #convert-arabic {
      appearance: textfield;
      -moz-appearance: textfield;
    }

    .converter-feedback {
      font-size: 12px;
      color: #fca5a5;
      min-height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      text-align: center;
    }

    .converter-feedback.hint {
      margin-top: 6px;
      padding: 6px 12px;
      border-radius: 12px;
      border: 1px solid rgba(45, 212, 191, 0.7);
      background: linear-gradient(135deg, rgba(20, 184, 166, 0.16), rgba(15, 23, 42, 0.96));
      color: #e5e7eb;
      box-shadow: 0 4px 10px rgba(15, 23, 42, 0.60);
    }

    /* Quiz */
    .quiz-box {
      width: 100%;
      margin: 0 auto 20px;
      padding: 18px 18px 19px;
      background:
        radial-gradient(circle at 0% 0%, rgba(148, 163, 184, 0.10), transparent 55%),
        linear-gradient(135deg, rgba(17, 24, 39, 0.84), rgba(15, 23, 42, 0.90));
      border-radius: 20px;
      box-shadow:
        0 8px 20px rgba(15, 23, 42, 0.40);
      border: 1px solid rgba(148, 163, 184, 0.28);
      backdrop-filter: blur(32px);
      -webkit-backdrop-filter: blur(32px);
      animation: card-fade-up 400ms ease-out 70ms both;
    }

    /* Date converter: etwas kompaktere Box, ohne das Headerbild zu verändern */
    #date-converter {
      padding-bottom: 12px;
    }

    #date-converter .converter-row {
      margin-bottom: 8px;
    }

    #date-feedback {
      min-height: 20px;
      margin-top: 2px;
    }

    /* Make header images in converter/quiz cards sit flush with the card border */
    .converter-box > .image-tile-media,
    .converter-box > .image-tile-media-secondary,
    .quiz-box > .image-tile-media {
      margin: -18px -18px 12px;
      border-radius: 20px 20px 0 0;
    }

    .quiz-box h2 {
      font-size: 19px;
      margin: 0 0 8px;
    }

    .quiz-desc {
      font-size: 13px;
      margin: 0 0 12px;
      color: var(--text-sub);
    }

    /* Image tile between quiz and content */
    .image-tile-card {
      width: 100%;
      margin: 0 auto 20px;
      padding: 0;
      border-radius: 20px;
      background: transparent;
      box-shadow: none;
      border: none;
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
      display: flex;
      align-items: stretch;
      justify-content: center;
    }

    .image-tile-media {
      flex: 1 1 auto;
      height: 240px;
      border-radius: 20px 20px 0 0;
      background:
        radial-gradient(circle at 0% 0%, rgba(148, 163, 184, 0.38), transparent 60%),
        linear-gradient(135deg, rgba(17, 24, 39, 0.55), rgba(15, 23, 42, 0.85));
      overflow: hidden;
      position: relative;
    }

    /* Third image tile after SEO content */
    .image-tile-card-tertiary {
      width: 100%;
      margin: 0 auto 24px;
      padding: 0;
      border-radius: 20px;
      background: transparent;
      box-shadow: none;
      border: none;
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
      display: flex;
      align-items: stretch;
      justify-content: center;
    }

    .image-tile-media-tertiary {
      flex: 1 1 auto;
      height: 240px;
      border-radius: 20px 20px 0 0;
      background:
        radial-gradient(circle at 0% 100%, rgba(148, 163, 184, 0.38), transparent 60%),
        linear-gradient(135deg, rgba(17, 24, 39, 0.55), rgba(15, 23, 42, 0.88));
      overflow: hidden;
      position: relative;
    }

    /* Second image tile after Schnell-Umrechner */
    .image-tile-card-secondary {
      width: 100%;
      margin: 0 auto 20px;
      padding: 0;
      border-radius: 20px;
      background: transparent;
      box-shadow: none;
      border: none;
      backdrop-filter: none;
      -webkit-backdrop-filter: none;
      display: flex;
      align-items: stretch;
      justify-content: center;
    }

    .image-tile-media-secondary {
      flex: 1 1 auto;
      height: 240px;
      border-radius: 20px 20px 0 0;
      background:
        radial-gradient(circle at 100% 0%, rgba(148, 163, 184, 0.38), transparent 60%),
        linear-gradient(135deg, rgba(17, 24, 39, 0.55), rgba(15, 23, 42, 0.88));
      overflow: hidden;
      position: relative;
    }

    .image-tile-media-img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      border-radius: inherit;
      transform: scale(1.06);
      transition: transform 260ms ease-out;
    }

    /* Visually connect image tiles with their following cards (image as header) */
    .image-tile-card,
    .image-tile-card-secondary,
    .image-tile-card-tertiary {
      display: block;
      line-height: 0;
      margin-bottom: 0;
      border-bottom-left-radius: 0;
      border-bottom-right-radius: 0;
    }

    /* Card directly under the image: no gap, flat top edge, rounded bottom as before */
    .image-tile-card-secondary + .converter-box,
    .image-tile-card + .converter-box,
    .image-tile-card + .quiz-box,
    .image-tile-card-tertiary + main {
      margin-top: -8px;
      border-top-left-radius: 0;
      border-top-right-radius: 0;
      border-top-width: 0;
    }

    .image-tile-card:hover .image-tile-media-img,
    .image-tile-card-secondary:hover .image-tile-media-img,
    .image-tile-card-tertiary:hover .image-tile-media-img,
    .converter-box.has-header-image:hover .image-tile-media-img,
    .quiz-box.has-header-image:hover .image-tile-media-img,
    main:hover .image-tile-media-tertiary .image-tile-media-img {
      transform: scale(1.00);
    }

    .quiz-question-row {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 4px;
      font-size: 14px;
      margin-bottom: 12px;
    }

    .quiz-level-row {
      margin-top: 2px;
      margin-bottom: 14px;
      font-size: 13px;
    }

    .quiz-level-header {
      display: flex;
      align-items: baseline;
      gap: 8px;
      justify-content: flex-start;
    }

    .quiz-level-control {
      margin-top: 6px;
      width: 100%;
    }

    #quiz-level {
      -webkit-appearance: none;
      appearance: none;
      width: 100%;
      margin: 0;
      height: 3px; /* schlankere Leiste auf allen Viewports */
      border-radius: 999px;
      background: rgba(148, 163, 184, 0.4);
      outline: none;
      cursor: pointer;
    }

    #quiz-level::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 17px;
      height: 17px;
      border-radius: 999px;
      background: var(--success);
      box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.9);
      border: 1px solid rgba(45, 212, 191, 0.9);
    }

    #quiz-level::-moz-range-thumb {
      width: 17px;
      height: 17px;
      border-radius: 999px;
      background: var(--success);
      box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.9);
      border: 1px solid rgba(45, 212, 191, 0.9);
    }

    .quiz-level-text {
      font-size: 11px;
      color: var(--muted);
    }

    .quiz-input-row {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 6px;
      margin-bottom: 8px;
    }

    .quiz-mode-row {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 6px;
      margin-bottom: 12px;
      font-size: 13px;
    }

    .quiz-mode-buttons {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      justify-content: flex-start;
    }

    .quiz-label {
      font-size: 13px;
      color: var(--text-sub);
    }

    #quiz-answer {
      flex: 1 1 120px;
      padding: 4px 8px;
      border-radius: 6px;
      border: 1px solid var(--border-soft);
      font-size: 13px;
      min-height: 28px;
      max-height: 40px; /* ca. 2 Zeilen */
      resize: vertical;
      line-height: 1.3;
    }

    .quiz-btn {
      padding: 7px 14px;
      border-radius: 10px;
      border: 1px solid rgba(148, 163, 184, 0.6);
      font-size: 13px;
      line-height: 1.3;
      cursor: pointer;
      background: linear-gradient(135deg, #111827, #020617);
      color: #e5e7eb;
      font-weight: 600;
      flex: 0 1 auto;
      box-shadow: 0 5px 12px rgba(15, 23, 42, 0.7);
      transition: background 0.12s ease, transform 0.06s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    }

    .date-output-row {
      margin-bottom: 6px;
    }

    .quiz-btn:hover {
      background: linear-gradient(135deg, #1a2433, #020617);
      transform: translateY(-1px);
      box-shadow: 0 5px 11px rgba(15, 23, 42, 0.7);
    }

    .quiz-btn-secondary {
      background: linear-gradient(135deg, #0f172a, #020617);
      border-color: rgba(148, 163, 184, 0.7);
      color: #e5e7eb;
    }

    .quiz-btn-secondary:hover {
      background: linear-gradient(135deg, #1f2937, #020617);
    }

    /* Extra spacing between answer input and buttons in standard quiz row */
    #quiz-standard-row #quiz-answer {
      margin-bottom: 4px;
    }

    /* Standard quiz action buttons: full-width, einheitliches Layout (wie im ursprünglichen Inline-CSS) */
    #quiz-standard-row .quiz-btn,
    #quiz-standard-row .quiz-btn-secondary {
      width: 100%;
      text-align: center;
      justify-content: center;
    }

    .quiz-feedback {
      font-size: 13px;
      height: 36px;
      margin-top: 0;
      padding: 4px 14px;
      border-radius: 10px;
      background: transparent;
      border: 1px solid transparent;
      color: var(--text-main);
      box-shadow: none;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      visibility: hidden;
      transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.18s ease;
    }

    .quiz-feedback.ok {
      visibility: visible;
      color: #eef2ff;
      background: linear-gradient(135deg, rgba(20, 184, 166, 0.96), rgba(15, 118, 110, 0.96));
      border-color: rgba(45, 212, 191, 0.85);
      box-shadow:
        0 8px 22px rgba(13, 148, 136, 0.70),
        0 0 0 1px rgba(45, 212, 191, 0.60);
    }

    .quiz-feedback.error {
      visibility: visible;
      color: #fecaca;
      background: linear-gradient(135deg, #7f1d1d, #111827);
      border-color: rgba(248, 113, 113, 0.7);
      box-shadow:
        0 0 0 1px rgba(127, 29, 29, 0.6),
        0 6px 16px rgba(15, 23, 42, 0.85);
    }

    .quiz-feedback.solution {
      visibility: visible;
      color: #e5e7eb;
      background: linear-gradient(135deg, #111827, #020617);
      border-color: rgba(148, 163, 184, 0.6);
      box-shadow:
        0 4px 10px rgba(15, 23, 42, 0.8);
    }

    @media (max-width: 720px) {
      .calculator-wrapper {
        max-width: 100%;
      }
      main {
        padding: 14px 12px 18px;
      }

      .converter-row {
        flex-direction: column;
        align-items: stretch;
      }

      .quiz-level-row {
        flex-direction: column;
        align-items: flex-start;
      }

      .quiz-input-row {
        flex-direction: column;
        align-items: stretch;
      }

      .quiz-mode-row {
        flex-direction: column;
        align-items: flex-start;
      }

      .quiz-mode-buttons {
        width: 100%;
        justify-content: stretch;
      }

      #quiz-answer {
        width: 100%;
      }

      .quiz-btn {
        width: 100%;
        text-align: center;
      }

      .date-output-group {
        width: 100%;
      }

      .date-output-row {
        flex-direction: column !important;
        align-items: stretch;
      }
    }

    @media (max-width: 480px) {
      body {
        font-size: 15px;
        line-height: 1.55;
      }

      .top-bar-inner {
        padding: 6px 12px; /* gleiche Seitenabstände wie main im Mobile-Layout */
      }

      .top-bar-title {
        font-size: 16px;  /* kompakter als Desktop, aber gut lesbar */
        letter-spacing: 0.04em;
      }

      .top-bar-subtitle,
      .top-bar-subline {
        font-size: 12px;
      }

      .quiz-desc,
      .converter-desc {
        font-size: 13px;
      }

      .badge {
        font-size: 12px;
        padding: 4px 12px;
      }

      .quiz-label,
      .converter-label {
        font-size: 14px;
      }

      #quiz-question {
        font-size: 15px;
      }

      .quiz-btn,
      .quiz-btn-secondary {
        font-size: 14px;
        padding: 8px 14px;
        min-height: 36px;
      }

      input,
      .converter-box input {
        font-size: 14px;
        min-height: 34px;
      }

      /* Schlankere Slider-Leiste auf sehr kleinen Screens */
      #quiz-level {
        height: 3px;
      }

      .converter-row-pretty {
        display: none;
      }
    }

