/* bahasa.css — Shared styles for /bahasa/* text tools (Anti-AI-Slop, Task-First) */
.bahasa-page {
  background: #f8fafc;
  color: #0f172a;
}

.bahasa-main {
  padding: 14px 0 40px;
}

.bahasa-main .wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.bahasa-hero {
  padding: 2px 0 14px;
}

.bahasa-hero h1 {
  margin: 0 0 4px;
  font-size: clamp(1.375rem, 1.1rem + 1.1vw, 1.875rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #0f172a;
}

.bahasa-hero .lead {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #475569;
  max-width: 68ch;
}

.bahasa-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.bahasa-workspace > * {
  min-width: 0;
}

.bahasa-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  box-sizing: border-box;
  min-width: 0;
}

.bahasa-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.bahasa-panel-head h2,
.bahasa-label {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.bahasa-label {
  display: block;
  margin-bottom: 6px;
}

.bahasa-textarea,
.bahasa-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.6;
  font-family: inherit;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bahasa-textarea {
  min-height: 200px;
  resize: vertical;
}

.bahasa-textarea-output {
  background: #f8fafc;
}

.bahasa-textarea:focus,
.bahasa-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.bahasa-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.bahasa-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #0f172a;
  cursor: pointer;
  line-height: 1.35;
}

.bahasa-toggle-label input[type="checkbox"] {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #2563eb;
  cursor: pointer;
}

.bahasa-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.bahasa-mode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.bahasa-mode-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.bahasa-mode-btn[aria-pressed="true"],
.bahasa-mode-btn.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.bahasa-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.bahasa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.bahasa-btn-primary {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.bahasa-btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.bahasa-btn-secondary {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}

.bahasa-btn-secondary:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.bahasa-btn:focus-visible,
.bahasa-mode-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.bahasa-status {
  margin: 8px 0 0;
  min-height: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #166534;
}

.bahasa-status.is-error {
  color: #b91c1c;
}

.bahasa-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 12px;
  padding: 10px 0;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.85rem;
  color: #475569;
  font-variant-numeric: tabular-nums;
}

.bahasa-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.bahasa-stat-val {
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.bahasa-note-inline {
  margin: 10px 0 0;
  font-size: 0.825rem;
  line-height: 1.5;
  color: #475569;
}

/* Diff Tool (bandingkan-teks) */
.diff-workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

.diff-inputs-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.diff-inputs-grid .bahasa-textarea {
  min-height: 148px;
}

.diff-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.diff-toolbar-left,
.diff-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.diff-view-tabs {
  display: inline-flex;
  gap: 6px;
}

.diff-output-box {
  margin-top: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.diff-split-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
}

.diff-split-header > div {
  padding: 8px 12px;
  min-width: 0;
}

.diff-split-header > div + div {
  border-left: 1px solid #e2e8f0;
}

.diff-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border-bottom: 1px solid #f1f5f9;
}

.diff-row:last-child {
  border-bottom: 0;
}

.diff-cell {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 10px;
  font-size: 0.92rem;
  line-height: 1.55;
  min-width: 0;
  align-items: baseline;
}

.diff-cell + .diff-cell {
  border-left: 1px solid #e2e8f0;
}

.diff-cell.is-del-row {
  background: #fef2f2;
}

.diff-cell.is-ins-row {
  background: #f0fdf4;
}

.diff-cell.is-empty-row {
  background: #f8fafc;
}

.diff-ln {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.78rem;
  color: #64748b;
  text-align: right;
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.diff-text {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}

.diff-del {
  background: #fee2e2;
  color: #991b1b;
  text-decoration: line-through;
  padding: 1px 2px;
  border-radius: 3px;
}

.diff-ins {
  background: #dcfce7;
  color: #166534;
  font-weight: 600;
  padding: 1px 2px;
  border-radius: 3px;
  text-decoration: none;
}

.diff-unified {
  padding: 12px 14px;
  font-size: 0.95rem;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.diff-empty-msg {
  padding: 16px;
  font-size: 0.9rem;
  color: #475569;
  margin: 0;
}

/* Below-the-fold guide & FAQ */
.bahasa-guide {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.bahasa-guide h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
}

.bahasa-guide details {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 14px;
  margin-bottom: 10px;
}

.bahasa-guide summary {
  font-weight: 700;
  font-size: 0.94rem;
  color: #0f172a;
  cursor: pointer;
  min-height: 28px;
  line-height: 1.45;
}

.bahasa-guide .faq-body {
  margin-top: 8px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #475569;
}

.bahasa-guide .faq-body p {
  margin: 0 0 8px;
}

.bahasa-guide .faq-body p:last-child {
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .diff-inputs-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .bahasa-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
  }

  .bahasa-output-pane {
    position: sticky;
    top: 76px;
  }
}

@media (max-width: 640px) {
  .bahasa-main {
    padding-top: 10px;
  }

  .bahasa-hero {
    padding-bottom: 10px;
  }

  .bahasa-panel {
    padding: 12px;
  }

  .bahasa-textarea {
    min-height: 150px;
  }

  .bahasa-options {
    grid-template-columns: 1fr;
    gap: 4px;
  }

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

  .diff-split-header {
    display: none;
  }

  .diff-row {
    grid-template-columns: minmax(0, 1fr);
    border-bottom: 2px solid #e2e8f0;
  }

  .diff-cell + .diff-cell {
    border-left: 0;
    border-top: 1px dashed #cbd5e1;
  }
}

@media print {
  .bahasa-output-pane {
    position: static;
  }
}

/* Wave 2 Checkers (cek-kata-baku, cek-kalimat-efektif, cek-grammar-inggris) */
.cek-highlight-box {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #0f172a;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-height: 76px;
  max-height: 280px;
  overflow-y: auto;
}

.cek-highlight-empty {
  color: #64748b;
  font-size: 0.875rem;
}

.cek-mark {
  background: #fef3c7;
  color: #92400e;
  border-bottom: 2px solid #d97706;
  border-radius: 3px;
  padding: 1px 2px;
  font-weight: 600;
}

.cek-mark-di,
.cek-mark-long {
  background: #fee2e2;
  color: #991b1b;
  border-bottom: 2px solid #dc2626;
}

.cek-mark-grammar {
  background: #dbeafe;
  color: #1e40af;
  border-bottom: 2px solid #2563eb;
}

.cek-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  max-height: 440px;
  overflow-y: auto;
}

.cek-empty-state {
  margin: 12px 0 0;
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.5;
}

.cek-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
}

.cek-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.cek-item-diff {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.cek-orig {
  color: #991b1b;
  background: #fef2f2;
  padding: 2px 6px;
  border-radius: 4px;
  text-decoration: line-through;
  font-weight: 600;
}

.cek-arrow {
  color: #64748b;
  font-weight: 600;
}

.cek-sugg {
  color: #166534;
  background: #f0fdf4;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.cek-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 2px 6px;
}

.cek-reason {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #475569;
}

.cek-item-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.cek-apply-btn {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 0.85rem;
}

.cek-privacy-note {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-left: 3px solid #2563eb;
  background: #f8fafc;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #334155;
}

.cek-attribution {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #475569;
}

.cek-attribution strong {
  color: #0f172a;
}

.cek-input-actions {
  margin-top: 10px;
}

.cek-quick-status {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  flex-wrap: wrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.cek-quick-status.is-empty {
  display: none;
}

.cek-quick-status.is-clean {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
}

.cek-quick-status.has-findings {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.cek-quick-status-text {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.cek-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  flex: none;
}

.cek-quick-status.is-clean .cek-status-dot {
  background: #16a34a;
}

.cek-quick-status.has-findings .cek-status-dot {
  background: #2563eb;
}

.cek-quick-status-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  border-radius: 8px;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #ffffff;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.cek-quick-status-btn:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.cek-quick-status-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}
