    * { box-sizing: border-box; margin: 0; padding: 0; }

    body {
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
      background: #f3f5fb;
      color: #111827;
      min-height: 100vh;
    }

    .app { display: flex; min-height: 100vh; }

    /* SIDEBAR */
    .sidebar {
      width: 72px;
      background: #ffffff;
      box-shadow: 4px 0 16px rgba(15, 23, 42, 0.06);
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 16px 0;
      gap: 16px;
    }

    .sidebar-logo {
      width: 40px;
      height: 40px;
      border-radius: 999px;
      background: #111827;
      color: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 20px;
      font-weight: 700;
      margin-bottom: 12px;
    }

    .sidebar-logo-img {
      width: 26px;
      height: 26px;
      object-fit: contain;
      display: block;
    }

    .sidebar-nav {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-top: 10px;
      padding: 10px;
    }

    .nav-btn {
      width: 40px;
      height: 40px;
      border-radius: 999px;
      border: none;
      background: transparent;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 18px;
      padding: 10px;
      color: #6b7280;
      transition: background 0.15s ease, color 0.15s ease, transform 0.1s;
    }

    .nav-btn img {
      width: 30px;
      height: 30px;
    }

    .nav-btn:hover { background: #e5e7eb; }

    .nav-btn.active {
      background: #f0f4fd;
      color: #f9fafb;
      transform: scale(1.05);
    }

    .sidebar-bottom {
      margin-top: auto;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    /* MAIN */
    .main {
      flex: 1;
      padding: 24px;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .topbar {
      background: #ffffff;
      border-radius: 16px;
      padding: 12px 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
    }

    .language-switcher {
      display: inline-flex;
      align-items: center;
      gap: 12px;
    }

    .lang-pill {
      padding: 6px 14px;
      border-radius: 999px;
      border: 1px solid #e5e7eb;
      background: #f9fafb;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      user-select: none;
    }

    .lang-pill.active {
      background: #111827;
      color: #f9fafb;
      border-color: #111827;
    }

    .swap-btn {
      width: 30px;
      height: 30px;
      border-radius: 999px;
      border: 1px solid #e5e7eb;
      background: #ffffff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      cursor: pointer;
    }

    .topbar-title {
      font-size: 14px;
      font-weight: 500;
      color: #6b7280;
    }

    /* VIEWS */
    .views {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .view { display: none; height: 100%; }
    .view.active { display: block; }

    /* 2 PANEL LAYOUT */
    .translate-layout {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 16px;
      height: 100%;
    }

    .card {
      background: #ffffff;
      border-radius: 20px;
      padding: 20px;
      box-shadow: 0 14px 25px rgba(15, 23, 42, 0.04);
      display: flex;
      flex-direction: column;
      height: 100%;
    }

    .card-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 12px;
      font-size: 13px;
      color: #6b7280;
      text-transform: uppercase;
      letter-spacing: 0.06em;
    }

    .textarea {
      width: 100%;
      flex: 1;
      border: none;
      resize: none;
      outline: none;
      font-size: 22px;
      line-height: 1.4;
      color: #111827;
      font-family: inherit;
      background: transparent;
      white-space: pre-wrap;
    }

    .textarea::placeholder { color: #9ca3af; }

    .card-footer {
      margin-top: 16px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 12px;
      color: #9ca3af;
    }

    .icon-row {
      display: flex;
      gap: 12px;
      align-items: center;
    }

    .icon-btn {
      width: 28px;
      height: 28px;
      border-radius: 999px;
      border: 1px solid #e5e7eb;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 14px;
      background: #ffffff;
      color: #4b5563;
    }

    .icon-btn img { width: 24px; height: 24px; }

    .icon-btn.copied {
      background: #dcfce7;
      border-color: #4ade80;
    }

    /* CENTER CARD (website/doc/image) */
    .center-card {
      background: #ffffff;
      border-radius: 20px;
      box-shadow: 0 14px 25px rgba(15, 23, 42, 0.04);
      padding: 40px 20px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      gap: 18px;
      height: 100%;
    }

    .center-icon {
      width: 80px;
      height: 80px;
      border-radius: 24px;
      background: #eff6ff;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 36px;
    }

    .center-title { font-size: 20px; font-weight: 600; }

    .center-subtitle {
      max-width: 420px;
      font-size: 14px;
      color: #6b7280;
    }

    .center-input {
      margin-top: 8px;
      width: 100%;
      max-width: 420px;
      padding: 10px 14px;
      border-radius: 999px;
      border: 1px solid #e5e7eb;
      font-size: 14px;
      outline: none;
    }

    .upload-box {
      width: 100%;
      max-width: 520px;
      min-height: 160px;
      border-radius: 18px;
      border: 1px dashed #cbd5f5;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 24px;
      font-size: 14px;
      color: #6b7280;
    }

    .upload-box span,
    .upload-link {
      color: #2563eb;
      cursor: pointer;
    }

    .upload-box.is-doc {
      flex-direction: column;
      gap: 8px;
      text-align: center;
      cursor: pointer;
    }

    .upload-box.is-doc.dragover {
      border-color: #2563eb;
      background: #eef2ff;
    }

    .upload-content {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }

    .upload-meta {
      font-size: 12px;
      color: #9ca3af;
    }

    .primary-btn {
      padding: 10px 18px;
      border: none;
      border-radius: 999px;
      background: #111827;
      color: #f9fafb;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
    }

    .primary-btn.small {
      padding: 6px 12px;
      font-size: 12px;
    }

    .primary-btn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    .doc-upload {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 12px;
      text-align: center;
      flex: 1;
    }

    .doc-icon {
      width: 44px;
      height: 44px;
      object-fit: contain;
    }

    .doc-status {
      min-height: 18px;
      font-size: 12px;
      color: #6b7280;
    }

    .doc-output-text {
      font-size: 16px;
      min-height: 320px;
    }

    .image-preview {
      width: 100%;
      max-width: 320px;
      max-height: 180px;
      border-radius: 12px;
      border: 1px solid #e5e7eb;
      object-fit: contain;
      background: #ffffff;
      display: none;
    }

    .image-preview.visible {
      display: block;
    }

    .image-url-input {
      max-width: 360px;
    }

    /* LANGUAGE MODAL (MyMemory) */
    .language-modal {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.35);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 50;
    }

    .language-modal.active { display: flex; }

    .language-dialog {
      background: #ffffff;
      border-radius: 16px;
      max-width: 960px;
      width: 90%;
      max-height: 80vh;
      padding: 16px 20px 20px;
      display: flex;
      flex-direction: column;
      gap: 12px;
      box-shadow: 0 24px 50px rgba(15, 23, 42, 0.25);
    }

    .language-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 15px;
      font-weight: 600;
    }

    .language-header button {
      border: none;
      background: transparent;
      font-size: 18px;
      cursor: pointer;
      color: #6b7280;
    }

    .language-top-row {
      display: flex;
      align-items: center;
      gap: 16px;
    }

    .language-search {
      flex: 1;
      padding: 8px 12px;
      border-radius: 8px;
      border: 1px solid #e5e7eb;
      font-size: 14px;
      outline: none;
    }

    .language-grid {
      margin-top: 4px;
      display: flex;
      gap: 24px;
      align-items: flex-start;
      overflow: auto;
      padding-right: 4px;
    }

    .language-column {
      flex: 1;
      min-width: 0;
      font-size: 14px;
    }

    .language-letter {
      margin: 6px 0 4px;
      font-weight: 600;
      color: #9ca3af;
    }

    .language-item {
      display: block;
      width: 100%;
      text-align: left;
      padding: 3px 0;
      border: none;
      background: none;
      cursor: pointer;
      font-size: 14px;
      color: #111827;
    }

    .language-item:hover { color: #2563eb; }

    .auto-detect {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      font-size: 13px;
      color: #4b5563;
      cursor: pointer;
    }

    .auto-detect input { display: none; }

    .auto-detect-slider {
      width: 34px;
      height: 18px;
      border-radius: 999px;
      background: #e5e7eb;
      position: relative;
      transition: background 0.2s;
    }

    .auto-detect-slider::before {
      content: "";
      position: absolute;
      top: 2px;
      left: 2px;
      width: 14px;
      height: 14px;
      border-radius: 999px;
      background: #ffffff;
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
      transition: transform 0.2s;
    }

    .auto-detect input:checked + .auto-detect-slider {
      background: #2563eb;
    }

    .auto-detect input:checked + .auto-detect-slider::before {
      transform: translateX(16px);
    }

    /* RESPONSIVE */
    @media (max-width: 960px) {
      .translate-layout {
        grid-template-columns: minmax(0, 1fr);
      }
    }

    @media (max-width: 640px) {
      .app {
        flex-direction: column;
      }
      .sidebar {
        flex-direction: row;
        width: 100%;
        height: 64px;
        padding: 8px 12px;
        justify-content: space-between;
      }
      .sidebar-nav {
        flex-direction: row;
        margin-top: 0;
      }
      .sidebar-bottom {
        flex-direction: row;
        margin-top: 0;
      }
      .main { padding: 16px; }
      .language-dialog {
        max-width: 100%;
        height: 90vh;
      }
      .language-grid { flex-direction: column; }
    }
