* {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    :root {
      --bg-color: #202124;
      --text-color: #e8eaed;
      --header-text-color: #e8eaed;
      --search-bg: #303134;
      --search-border: #5f6368;
      --search-hover-bg: #303134;
      --search-shadow: rgba(0, 0, 0, 0.3);
      --search-icon-color: #9aa0a6;
      --btn-bg: #303134;
      --btn-border: #303134;
      --btn-text: #e8eaed;
      --btn-hover-border: #5f6368;
      --btn-hover-bg: #3c4043;
      --lang-color: #bdc1c6;
      --lang-link: #8ab4f8;
      --top-loader-bg: #8ab4f8;
      --apps-hover: rgba(232, 234, 237, 0.08);
      --popover-bg: #303134;
      --popover-border: #5f6368;
      --popover-hover: rgba(255, 255, 255, 0.08);
      --popover-shadow: rgba(0, 0, 0, 0.35);
    }

    body.light-theme {
      --bg-color: #ffffff;
      --text-color: #202124;
      --header-text-color: #1f1f1f;
      --search-bg: #ffffff;
      --search-border: #dfe1e5;
      --search-hover-bg: #ffffff;
      --search-shadow: rgba(32, 33, 36, 0.28);
      --search-icon-color: #9aa0a6;
      --btn-bg: #f1f3f4;
      --btn-border: #f1f3f4;
      --btn-text: #3c4043;
      --btn-hover-border: #dadce0;
      --btn-hover-bg: #e8eaed;
      --lang-color: #4d5156;
      --lang-link: #1a0dab;
      --top-loader-bg: #4285f4;
      --apps-hover: rgba(60, 64, 67, 0.08);
      --popover-bg: #ffffff;
      --popover-border: #dfe1e5;
      --popover-hover: #f1f3f4;
      --popover-shadow: rgba(0, 0, 0, 0.15);
    }

    body {
      background-color: var(--bg-color);
      color: var(--text-color);
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      user-select: none;
      overflow-x: hidden;
      position: relative;
      transition: background-color 0.2s ease, color 0.2s ease;
    }

    /* Barra de progreso superior al buscar */
    #top-loader {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 3px;
      background: transparent;
      overflow: hidden;
      z-index: 9999;
      display: none;
    }

    #top-loader .bar {
      position: absolute;
      background-color: var(--top-loader-bg);
      height: 100%;
      animation: indeterminate 1.6s infinite ease-in-out;
    }

    @keyframes indeterminate {
      0% {
        left: -35%;
        right: 100%;
      }
      60% {
        left: 100%;
        right: -90%;
      }
      100% {
        left: 100%;
        right: -90%;
      }
    }

    /* Header alineado a nivel de píxel */
    header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 12px 24px;
      font-size: 13px;
      position: relative;
      min-height: 56px;
    }

    .nav-group {
      display: flex;
      align-items: center;
      gap: 16px;
      height: 40px;
    }

    /* Textos estáticos superiores con alineación exacta */
    .nav-plain-text {
      color: var(--header-text-color);
      font-size: 13px;
      cursor: default;
      user-select: none;
      text-decoration: none;
      opacity: 0.88;
      display: inline-flex;
      align-items: center;
      height: 100%;
      line-height: 1;
    }

    .nav-plain-text:hover {
      text-decoration: none !important;
      opacity: 0.88;
    }

    /* Botón 9 puntos */
    .apps-icon-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 40px;
      height: 40px;
      border-radius: 50%;
      cursor: pointer;
      color: var(--header-text-color);
      background: transparent;
      border: none;
      transition: background-color 0.15s;
    }

    .apps-icon-btn:hover {
      background-color: var(--apps-hover);
    }

    .apps-icon-btn svg {
      fill: var(--header-text-color);
      width: 20px;
      height: 20px;
    }

    /* Pequeño panel desplegable tipo Google */
    .apps-popover {
      position: absolute;
      top: 56px;
      right: 20px;
      background: var(--popover-bg);
      border: 1px solid var(--popover-border);
      border-radius: 16px;
      box-shadow: 0 4px 18px var(--popover-shadow);
      padding: 6px;
      display: none;
      flex-direction: column;
      min-width: 170px;
      z-index: 1000;
      animation: fadeIn 0.12s ease-out;
    }

    .apps-popover.open {
      display: flex;
    }

    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(-6px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .popover-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 9px 12px;
      border-radius: 10px;
      color: var(--text-color);
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      text-decoration: none;
      background: transparent;
      border: none;
      width: 100%;
      text-align: left;
      font-family: 'Google Sans', Roboto, sans-serif;
      transition: background-color 0.12s;
    }

    .popover-item:hover {
      background-color: var(--popover-hover);
    }

    .popover-item svg {
      width: 17px;
      height: 17px;
      flex-shrink: 0;
      color: var(--text-color);
    }

    .popover-divider {
      height: 1px;
      background: var(--popover-border);
      margin: 4px 6px;
    }

    /* Main Container (centrado y elevado) */
    main {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 0 20px;
      margin-top: -85px;
    }

    /* Logo Google (Dinámico: Blanco en Dark, Multicolor en Light) */
    .logo-container {
      margin-bottom: 26px;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .logo-dark {
      font-family: 'Google Sans', Roboto, Arial, sans-serif;
      font-size: 92px;
      font-weight: 500;
      color: #ffffff;
      letter-spacing: -2px;
      line-height: 1;
      display: block;
    }

    .logo-light {
      font-family: 'Google Sans', Roboto, Arial, sans-serif;
      font-size: 92px;
      font-weight: 500;
      letter-spacing: -2px;
      line-height: 1;
      display: none;
    }

    body.light-theme .logo-dark {
      display: none;
    }
    body.light-theme .logo-light {
      display: block;
    }

    .g-blue { color: #4285f4; }
    .g-red { color: #ea4335; }
    .g-yellow { color: #fbbc05; }
    .g-green { color: #34a853; }

    /* Barra de búsqueda */
    .search-box-container {
      width: 100%;
      max-width: 692px;
      position: relative;
    }

    .search-box {
      width: 100%;
      height: 48px;
      background-color: var(--search-bg);
      border: 1px solid var(--search-border);
      border-radius: 24px;
      display: flex;
      align-items: center;
      padding: 0 16px;
      transition: background-color 0.2s, box-shadow 0.2s, border-color 0.2s;
    }

    .search-box:hover, .search-box:focus-within {
      background-color: var(--search-hover-bg);
      box-shadow: 0 1px 6px var(--search-shadow);
      border-color: var(--search-border);
    }

    body.light-theme .search-box:hover, 
    body.light-theme .search-box:focus-within {
      border-color: transparent;
    }

    /* Icono lupa de búsqueda izquierda */
    .search-icon-btn {
      background: transparent;
      border: none;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--search-icon-color);
      margin-right: 12px;
      cursor: pointer;
      padding: 2px;
    }

    .search-icon-btn svg {
      width: 20px;
      height: 20px;
      fill: var(--search-icon-color);
      transition: fill 0.2s;
    }

    .search-box:hover .search-icon-btn svg,
    .search-box:focus-within .search-icon-btn svg {
      fill: var(--text-color);
    }

    .search-input {
      flex: 1;
      background: transparent;
      border: none;
      outline: none;
      color: var(--text-color);
      font-size: 16px;
      font-family: inherit;
      height: 100%;
      user-select: text;
    }

    .search-input::placeholder {
      color: transparent;
    }

    /* Contenedor de iconos derecha (Micrófono y Lens) */
    .search-tools-right {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-left: 10px;
    }

    .tool-btn {
      background: transparent;
      border: none;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 4px;
      border-radius: 50%;
      color: var(--text-color);
      transition: opacity 0.15s;
    }

    .tool-btn:hover {
      opacity: 0.8;
    }

    .tool-btn svg {
      width: 24px;
      height: 24px;
    }

    /* Botones de acción */
    .buttons-container {
      display: flex;
      justify-content: center;
      gap: 12px;
      margin-top: 28px;
    }

    .google-btn {
      background-color: var(--btn-bg);
      border: 1px solid var(--btn-border);
      color: var(--btn-text);
      font-family: inherit;
      font-size: 14px;
      padding: 0 16px;
      height: 36px;
      border-radius: 4px;
      cursor: pointer;
      transition: border-color 0.1s, background-color 0.1s, box-shadow 0.1s;
    }

    .google-btn:hover {
      border: 1px solid var(--btn-hover-border);
      background-color: var(--btn-hover-bg);
    }

    body.light-theme .google-btn:hover {
      box-shadow: 0 1px 1px rgba(0,0,0,0.1);
      color: #202124;
    }

    /* Texto idioma */
    .languages-container {
      margin-top: 28px;
      font-size: 13px;
      color: var(--lang-color);
      text-align: center;
    }

    .languages-container .lang-word {
      color: var(--lang-link);
      margin-left: 4px;
      cursor: default;
    }

    /* Pantalla de carga oficial de Google (Solo spinner circular) */
    #loading-overlay {
      position: fixed;
      inset: 0;
      background: var(--bg-color);
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease;
      z-index: 1000;
      cursor: pointer;
    }

    #loading-overlay.active {
      opacity: 1;
      pointer-events: all;
    }

    .google-spinner {
      animation: rotate-spinner 2s linear infinite;
      height: 52px;
      width: 52px;
      transform-origin: center center;
    }

    .google-spinner .path {
      stroke-dasharray: 1, 200;
      stroke-dashoffset: 0;
      stroke-linecap: round;
      stroke-width: 4;
      animation: dash-spinner 1.5s ease-in-out infinite, color-spinner 6s ease-in-out infinite;
    }

    @keyframes rotate-spinner {
      100% {
        transform: rotate(360deg);
      }
    }

    @keyframes dash-spinner {
      0% {
        stroke-dasharray: 1, 200;
        stroke-dashoffset: 0;
      }
      50% {
        stroke-dasharray: 89, 200;
        stroke-dashoffset: -35px;
      }
      100% {
        stroke-dasharray: 89, 200;
        stroke-dashoffset: -124px;
      }
    }

    @keyframes color-spinner {
      100%, 0% {
        stroke: #4285f4;
      }
      40% {
        stroke: #ea4335;
      }
      66% {
        stroke: #fbbc05;
      }
      80%, 90% {
        stroke: #34a853;
      }
    }
