/* Braille Converter Styles */
.statmat-tool.braille-converter {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  max-width: 800px;
  margin: 0 auto;
  color: #333;
  background-color: #fcfcfc;
  border: 1px solid #eaeaea;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.statmat-tool.braille-converter * {
  box-sizing: border-box;
}

.statmat-tool.braille-converter .converter-header {
  text-align: center;
  margin-bottom: 32px;
}

.statmat-tool.braille-converter .converter-header h2 {
  font-size: 32px;
  margin: 0 0 4px 0;
  letter-spacing: 4px;
  color: #1a1a1a;
}

.statmat-tool.braille-converter .converter-header p {
  margin: 0;
  font-size: 16px;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.statmat-tool.braille-converter .converter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.statmat-tool.braille-converter label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #444;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.statmat-tool.braille-converter .input-pane textarea {
  width: 100%;
  padding: 16px;
  border: 2px solid #eaeaea;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
  min-height: 180px;
  transition: border-color 0.2s;
  background-color: #fff;
  line-height: 1.5;
  margin-bottom: 12px;
}

.statmat-tool.braille-converter .input-pane textarea:focus {
  outline: none;
  border-color: #4a90e2;
}

.statmat-tool.braille-converter .braille-display {
  width: 100%;
  padding: 16px;
  border: 2px dashed #ccc;
  border-radius: 8px;
  font-size: 36px; /* Very large font for braille readability */
  resize: vertical;
  min-height: 180px;
  background-color: #f9f9f9;
  line-height: 1.4;
  margin-bottom: 12px;
  word-break: break-all;
  overflow-y: auto;
}

.statmat-tool.braille-converter .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  width: 100%;
  font-size: 15px;
}

.statmat-tool.braille-converter .btn-primary {
  background-color: #1a1a1a;
  color: #fff;
}

.statmat-tool.braille-converter .btn-primary:hover {
  background-color: #333;
}

.statmat-tool.braille-converter .btn-secondary {
  background-color: #f0f0f0;
  color: #333;
}

.statmat-tool.braille-converter .btn-secondary:hover {
  background-color: #e0e0e0;
}

.statmat-tool.braille-converter .options {
  display: flex;
  gap: 24px;
  padding: 16px;
  background-color: #f5f5f5;
  border-radius: 8px;
  justify-content: center;
}

.statmat-tool.braille-converter .checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: normal;
  text-transform: none;
  letter-spacing: normal;
  margin-bottom: 0;
  cursor: pointer;
}

.statmat-tool.braille-converter input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #1a1a1a;
}

/* Toast */
.statmat-tool.braille-converter .toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: #1a1a1a;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
  z-index: 9999;
}

.statmat-tool.braille-converter .toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 640px) {
  .statmat-tool.braille-converter .converter-grid {
    grid-template-columns: 1fr;
  }
  
  .statmat-tool.braille-converter .options {
    flex-direction: column;
    gap: 12px;
  }
}

/* Global override for mobile scrolling on long results */
.statmat-tool [class*="result"], 
.statmat-tool [class*="output"],
.statmat-tool [class*="preview"],
.statmat-tool [class*="display"] {
  overflow-x: auto;
  max-width: 100%;
}

/* Global safeguard: ensure main wrapper never exceeds mobile viewport */
.statmat-tool {
  width: 100% !important;
  box-sizing: border-box;
}
