* {
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
body {
  margin: 0;
  padding: 20px;
  background-color: #f5f7fb;
  color: #333;
}
.container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
}
.top-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: stretch;
}
@media (min-width: 1024px) {
  .top-panel {
    grid-template-columns: 1fr 2.5fr;
  }
}
.card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
}
.card h2 {
  margin-top: 0;
  font-size: 1.1rem;
  color: #4a5568;
  border-bottom: 1px solid #edf2f7;
  padding-bottom: 10px;
  margin-bottom: 15px;
}
.left-input {
  gap: 15px;
}
.left-input .content-area {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
textarea {
  width: 100%;
  height: 100%;
  min-height: 250px;
  resize: vertical;
  padding: 10px;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9rem;
}
button {
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
button:active {
  transform: scale(0.99);
}
#parse-btn {
  background-color: #4a5568;
  color: white;
  font-size: 1rem;
  margin-top: auto;
}
#parse-btn:hover {
  background-color: #2d3748;
}
#predict-btn {
  background-color: #3182ce;
  color: white;
  font-size: 1.05rem;
}
#predict-btn:hover {
  background-color: #2b6cb0;
}
.right-output {
  gap: 15px;
}
.markers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 10px 8px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 5px;
  flex-grow: 1;
  align-content: start;
}
.select-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #edf2f7;
}
.select-group label {
  font-size: 0.9rem;
  color: #4a5568;
  font-weight: 500;
}
select {
  padding: 8px;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  background: white;
  font-size: 0.95rem;
  width: 100%;
}
.marker-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.marker-field label {
  font-size: 0.75rem;
  color: #718096;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  font-weight: 600;
}
.marker-field input {
  padding: 6px 5px;
  border: 1px solid #e2e8f0;
  border-radius: 3px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: bold;
  color: #2d3748;
  width: 100%;
  transition: background-color 1s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.marker-field input:focus {
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.2);
  outline: none;
}
.panel-divider {
  grid-column: 1 / -1;
  margin: 15px 0 5px 0;
  padding-bottom: 5px;
  font-size: 0.75rem;
  font-weight: bold;
  color: #4a5568;
  border-bottom: 2px solid #cbd5e0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.panel-divider:first-child {
  margin-top: 0;
}
.tree-container {
  min-height: 120px;
}
#tree-result {
  padding: 10px 0;
}
.tree-flat-chain {
  list-style-type: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}
.tree-flat-chain li {
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
}
.tree-flat-chain .tree-arrow {
  color: #a0aec0;
  font-weight: bold;
  font-size: 1.1rem;
  user-select: none;
}
.node-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ebf8ff;
  border: 1px solid #bee3f8;
  padding: 6px 12px;
  border-radius: 4px;
  white-space: nowrap;
}
.node-name {
  font-weight: bold;
  color: #2b6cb0;
}
.node-prob {
  font-size: 0.85rem;
  color: #4a5568;
  background: #e2e8f0;
  padding: 2px 6px;
  border-radius: 10px;
}
.placeholder-text {
  color: #a0aec0;
  font-style: italic;
  margin: 0;
}
.status-error {
  color: #e53e3e;
  font-weight: bold;
  margin: 0;
}
.status-success {
  color: #319795;
  font-weight: 500;
  margin: 0;
}
.status-loading {
  color: #3182ce;
  margin: 0;
  animation: pulse 1.5s infinite ease-in-out;
}
.highlight-pulse {
  background-color: #e6fffa !important;
  border-color: #319795 !important;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}
