/* Ancient Script Translator Custom Styles */
.anc-wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 0 24px;
}

.anc-wrap textarea {
  width: 100%;
  font-size: 14px;
  padding: 12px 14px;
  border: .5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  resize: vertical;
  line-height: 1.7;
}

.anc-wrap textarea:focus {
  outline: none;
  border-color: var(--navy);
}

/* Pill Row */
.anc-wrap .pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.anc-wrap .pill {
  padding: 6px 14px;
  border: .5px solid var(--border);
  border-radius: 99px;
  font-size: 12px;
  cursor: pointer;
  background: var(--white);
  color: var(--text-muted);
  transition: all .1s;
}

.anc-wrap .pill:hover {
  background: var(--gray-50);
  color: var(--text);
}

.anc-wrap .pill.sel {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

/* Output Main */
.anc-wrap .output-main {
  background: var(--white);
  border: .5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 12px;
  min-height: 100px;
}

/* Script Line */
.anc-wrap .script-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-end;
  line-height: 1;
}

.anc-wrap .sc-char {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px 6px;
  border-radius: var(--radius);
  transition: background .1s;
  min-width: 36px;
}

.anc-wrap .sc-char:hover {
  background: var(--gray-50);
}

.anc-wrap .sc-glyph {
  font-size: 28px;
  line-height: 1;
  color: var(--text);
  text-align: center;
}

.anc-wrap .sc-latin {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  font-family: var(--font-mono);
}

.anc-wrap .sc-word-sep {
  width: 1px;
  background: var(--border);
  margin: 0 6px;
  height: 44px;
  align-self: center;
}

.anc-wrap .output-text {
  font-size: 24px;
  line-height: 1.8;
  color: var(--text);
  letter-spacing: 2px;
  word-break: break-all;
}

.anc-wrap .phonetic-line {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 12px;
  font-family: var(--font-mono);
  letter-spacing: 1px;
  word-break: break-all;
}

/* Dir Badge */
.anc-wrap .dir-badge {
  display: inline-block;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 600;
  margin-left: 6px;
}

.anc-wrap .rtl-badge {
  background: #fef3c7;
  color: #92400e;
}

.anc-wrap .ltr-badge {
  background: #d1fae5;
  color: #065f46;
}

/* Tabs */
.anc-wrap .tabs {
  display: flex;
  gap: 0;
  border-bottom: .5px solid var(--border);
  margin-bottom: 12px;
}

.anc-wrap .tab {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -0.5px;
  transition: all .1s;
}

.anc-wrap .tab.sel {
  color: var(--text);
  border-bottom-color: var(--text);
}

.anc-wrap .tab-panel {
  display: none;
}

.anc-wrap .tab-panel.sel {
  display: block;
}

/* Ref Grid */
.anc-wrap .ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.anc-wrap .ref-cell {
  background: var(--white);
  border: .5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  transition: background .1s;
}

.anc-wrap .ref-cell:hover {
  background: var(--gray-50);
}

.anc-wrap .ref-glyph {
  font-size: 26px;
  color: var(--text);
  line-height: 1.2;
}

.anc-wrap .ref-lat {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: var(--font-mono);
}

.anc-wrap .ref-name {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.2;
}

/* Info Box */
.anc-wrap .info-box {
  background: var(--gray-50);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.8;
}

/* Hint Row */
.anc-wrap .hint-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.anc-wrap .hint {
  padding: 4px 12px;
  background: var(--gray-50);
  border-radius: 99px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  border: .5px solid var(--border);
}

.anc-wrap .hint:hover {
  color: var(--text);
  border-color: var(--gray-400);
}

/* Buttons */
.anc-wrap .btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.anc-wrap .btn {
  padding: 8px 16px;
  border: .5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all .1s;
}

.anc-wrap .btn:hover {
  background: var(--gray-50);
}

.anc-wrap .btn.primary {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.anc-wrap .btn.primary:hover {
  opacity: 0.85;
}

.anc-wrap .btn.success {
  background: #059669;
  color: var(--white);
  border-color: #059669;
}

/* Hide default tool layout */
.tool-page .gen-heading {
  position: absolute;
  left: -9999px;
}

.tool-page .tool-output-grid {
  display: none;
}

.tool-interface {
  min-height: auto;
  padding: 0;
  background: transparent;
}