    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
    position: relative;
    text-align: left;
  }

  /* Language row above panels */
  .tw-lang-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 2px;
  }

  .tw-lang-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    color: #18181B;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.15s;
    line-height: 1;
  }
  .tw-lang-label:hover {
    background: rgba(0,0,0,0.05);
  }
  .tw-lang-label svg {
    color: #52525B;
    flex-shrink: 0;
  }
  .tw-lang-flag {
    flex-shrink: 0;
  }

  .tw-lang-spacer {
    flex: 1;
  }

  /* Panels container */
  .tw-panels {
    display: flex;
    gap: 0;
    align-items: stretch;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
    overflow: visible;
    position: relative;
  }

  /* Individual panel */
  .tw-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border: 1px solid rgba(0, 0, 0, 0.10);
    border-radius: 0;
    overflow: visible;
    min-width: 0;
  }
  .tw-panel:first-child {
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
  }
  .tw-panel:last-child {
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
  }

  .tw-panel-result {
    background: #FFFFFF;
    border-left: 1px solid rgba(0,0,0,0.06);
  }

  /* Textarea */
  .tw-textarea {
    flex: 1;
    width: 100%;
    resize: none;
    border: none;
    outline: none;
    padding: 16px 18px;
    font-size: 16px;
    line-height: 1.6;
    color: #18181B;
    background: transparent;
    font-family: inherit;
    min-height: 340px;
  }
  .tw-textarea::placeholder {
    color: #AEAEB2;
  }
  .tw-textarea-result {
    color: #1C1C1E;
  }

  /* Result area (relative for loader) */
  .tw-result-area {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
  }

  /* Loader */
  .tw-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.85);
  }
  .tw-loader.hidden {
    display: none;
  }

  @keyframes tw-spin {
    to { transform: rotate(360deg); }
  }
  .tw-spinner {
    animation: tw-spin 0.8s linear infinite;
  }

  /* Footer */
  .tw-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px 11px;
    border-top: none;
    gap: 6px;
    min-height: 50px;
  }

  .tw-footer-left {
    display: flex;
    align-items: center;
    gap: 2px;
  }

  .tw-footer-right {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  /* Icon buttons in footer */
  .tw-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    color: #8E8E93;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
  }
  .tw-icon-btn:hover {
    color: #1C1C1E;
    background: rgba(0,0,0,0.06);
  }
  .tw-icon-btn.hidden {
    display: none;
  }

  /* Style dropdown button */
  .tw-style-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    color: #636366;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
    line-height: 1;
  }
  .tw-style-btn:hover {
    background: rgba(0,0,0,0.06);
    color: #1C1C1E;
  }

  /* Style dropdown popup */
  .tw-style-dropdown {
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    z-index: 9999;
    background: #FFFFFF;
    border: 1px solid #E4E4E7;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.06);
    min-width: 140px;
    padding: 4px;
  }
  .tw-style-dropdown.hidden {
    display: none;
  }
  .tw-style-item {
    display: block;
    width: 100%;
    padding: 8px 14px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    color: #18181B;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    border-radius: 7px;
    transition: background 0.12s;
    white-space: nowrap;
  }
  .tw-style-item:hover {
    background: #F4F4F5;
  }
  /* Style hint tooltip */
  .tw-style-hint {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #18181B;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    animation: hintPulse 2s ease-in-out infinite, hintFadeIn 0.3s ease-out;
    z-index: 10;
  }
  .tw-style-hint::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #18181B;
  }
  .tw-style-hint.hidden { display: none; }
  @keyframes hintPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 1; }
  }
  @keyframes hintFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(4px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
  }

  .tw-style-active {
    color: #3870F2;
    font-weight: 600;
  }

  /* Translate button */
  .tw-translate-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #FFFFFF;
    background: #2563EB;
    border: none;
    border-radius: 100px;
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(56, 112, 242, 0.4);
  }
  .tw-translate-btn:hover {
    background: #2959d4;
    box-shadow: 0 6px 20px rgba(56, 112, 242, 0.5);
    transform: translateY(-1px);
  }
  .tw-translate-btn:active {
    transform: scale(0.97);
  }
  .tw-translate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
  }
  .tw-shortcut {
    font-size: 11px;
    font-weight: 500;
    opacity: 1;
    font-family: inherit;
    letter-spacing: 0.5px;
  }
  /* Expand button */
  .tw-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 36px;
    padding: 0 14px;
    color: #52525B;
    background: none;
    border: 1px solid #E4E4E7;
    border-radius: 100px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    white-space: nowrap;
  }
  .tw-expand-btn:hover {
    background: #F4F4F5;
    color: #3870F2;
    border-color: #3870F2;
  }
  .tw-expand-label {
    line-height: 1;
  }

  /* Swap button — floats over the divider line */
  .tw-swap-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 1.5px solid #E4E4E7;
    color: #52525B;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  }
  .tw-swap-btn:hover {
    background: #EEF3FE;
    color: #3870F2;
    border-color: #3870F2;
    transform: translate(-50%, -50%) rotate(180deg);
  }

  /* Error */
  .tw-error {
    font-size: 11px;
    color: #FF3B30;
  }
  .tw-error.hidden {
    display: none;
  }

  /* Language dropdown */
  .tw-lang-dropdown {
    position: absolute;
    background: #FFFFFF;
    border: 1px solid #E4E4E7;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    z-index: 100;
    min-width: 200px;
    max-height: 320px;
    overflow-y: auto;
    display: none;
    padding: 6px;
    text-align: left;
  }
  .tw-lang-dropdown.open {
    display: block;
  }
  .tw-lang-dropdown-list {
    display: flex;
    flex-direction: column;
  }
  .tw-lang-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    padding: 7px 12px !important;
    font-size: 14px;
    font-weight: 500;
    color: #18181B;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.12s;
    border: none;
    background: none;
    text-align: left !important;
    font-family: inherit;
    white-space: nowrap;
    width: 100%;
    line-height: 1.2;
  }
  .tw-lang-item:hover {
    background: #F4F4F5;
  }
  .tw-lang-item.active {
    background: #EEF3FE;
    color: #3870F2;
  }
  .tw-lang-item img {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
  }
  .tw-lang-item span {
    text-align: left;
  }

  /* Mobile */
  @media (max-width: 600px) {
    .tw-panels {
      flex-direction: column;
      border-radius: 14px;
    }
    .tw-panel:first-child {
      border-top-left-radius: 14px;
      border-top-right-radius: 14px;
      border-bottom-left-radius: 0;
    }
    .tw-panel:last-child {
      border-bottom-left-radius: 14px;
      border-bottom-right-radius: 14px;
      border-top-right-radius: 0;
      border-left: 1px solid rgba(0,0,0,0.10);
      border-top: 1px solid rgba(0,0,0,0.10);
    }
    .tw-swap-btn {
      transform: translate(-50%, -50%) rotate(90deg);
    }
    .tw-swap-btn:hover {
      transform: translate(-50%, -50%) rotate(270deg);
    }
    /* Translate button: full width of source panel, aligned right */
    .tw-panel:first-child .tw-footer {
      flex-wrap: wrap;
    }
    .tw-panel:first-child .tw-footer-right {
      width: 100%;
      justify-content: flex-end;
    }
    .tw-translate-btn {
      width: 100%;
      justify-content: center;
    }
  }

  /* Auth gate popup */
  .tw-auth-gate {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .tw-auth-gate.hidden { display: none; }
  .tw-auth-gate-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
  }
  .tw-auth-gate-card {
    position: relative;
    background: #fff;
    border-radius: 20px;
    padding: 40px 32px 32px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    animation: authGateFadeIn 0.25s ease-out;
  }
  @keyframes authGateFadeIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
  }
  .tw-auth-gate-icon { margin-bottom: 16px; }
  .tw-auth-gate-title {
    font-size: 20px;
    font-weight: 700;
    color: #18181B;
    margin: 0 0 8px;
  }
  .tw-auth-gate-desc {
    font-size: 14px;
    color: #52525B;
    margin: 0 0 24px;
    line-height: 1.5;
  }
  .tw-auth-gate-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: #2563EB;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s;
    margin-bottom: 12px;
  }
  .tw-auth-gate-btn:hover { background: #2959d4; }
  .tw-auth-gate-dismiss {
    background: none;
    border: none;
    color: #A1A1AA;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    padding: 4px 8px;
  }
