/* YouTube Description Formatter Custom Styles */
.yt-tool-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 0 24px;
}

/* Labels */
.lbl {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 8px;
}

/* Video Info Row */
.vid-info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.vid-info-row input {
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  border: .5px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  color: var(--text);
}

.vid-info-row input:focus {
  outline: none;
  border-color: var(--navy);
}

/* Section Editor */
.section-editor {
  border: .5px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  margin-bottom: 16px;
  overflow: hidden;
}

.sec-editor-head {
  padding: 10px 14px;
  border-bottom: .5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-50);
}

.sec-editor-head span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  flex: 1;
}

/* Chapter Row */
.chapter-row {
  display: grid;
  grid-template-columns: 70px 28px 1fr 28px;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.chapter-row input[type="text"] {
  padding: 6px 8px;
  font-size: 13px;
  border: .5px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  color: var(--text);
  width: 100%;
}

.chapter-row input[type="text"]:focus {
  outline: none;
  border-color: var(--navy);
}

/* Emoji Pick */
.emoji-pick {
  padding: 4px 6px;
  font-size: 15px;
  border: .5px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  cursor: pointer;
  text-align: center;
  line-height: 1.4;
}

.emoji-pick:hover {
  background: var(--gray-50);
}

.emoji-picker-wrap {
  position: relative;
  display: inline-block;
}

.emoji-dropdown {
  position: absolute;
  top: 34px;
  left: 0;
  z-index: 50;
  background: var(--white);
  border: .5px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  display: none;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  width: 200px;
}

.emoji-dropdown.open {
  display: grid;
}

.ep-item {
  font-size: 16px;
  padding: 4px;
  text-align: center;
  cursor: pointer;
  border-radius: 4px;
  line-height: 1.4;
}

.ep-item:hover {
  background: var(--gray-50);
}

/* Icon Buttons */
.icon-btn {
  width: 28px;
  height: 28px;
  border: .5px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all .12s;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--gray-50);
  color: var(--text);
}

.icon-btn.danger:hover {
  background: #fef2f2;
  color: #c00;
  border-color: #fca5a5;
}

/* Links Grid */
.links-grid {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.link-row {
  display: grid;
  grid-template-columns: 26px 1fr 1fr 28px;
  gap: 6px;
  align-items: center;
}

.link-row input {
  padding: 6px 8px;
  font-size: 13px;
  border: .5px solid var(--border);
  border-radius: 4px;
  background: var(--white);
  color: var(--text);
  width: 100%;
}

.link-row input:focus {
  outline: none;
  border-color: var(--navy);
}

.link-emoji {
  font-size: 16px;
  text-align: center;
}

/* Tags Area */
.tags-area {
  padding: 8px;
}

.tags-area textarea {
  height: 60px;
  resize: none;
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  border: .5px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  color: var(--text);
}

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

/* Toolbar */
.toolbar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}

.tbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: .5px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  color: var(--text-muted);
  transition: all .12s;
}

.tbar-btn:hover {
  background: var(--gray-50);
  color: var(--text);
}

.tbar-btn.on {
  background: var(--navy);
  color: var(--white);
  border-color: transparent;
}

.tbar-sep {
  width: 1px;
  height: 20px;
  background: var(--border);
}

/* Two Column Layout */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .two-col {
    grid-template-columns: 1fr;
  }

  .vid-info-row {
    grid-template-columns: 1fr;
  }
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 0;
}

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

.panel-title {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
}

textarea#raw-output {
  width: 100%;
  min-height: 200px;
  resize: vertical;
  font-size: 12px;
  line-height: 1.6;
  font-family: monospace;
  border: .5px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  padding: 12px 14px;
}

textarea#raw-output:focus {
  outline: none;
  border-color: var(--navy);
}

.preview-box {
  border: .5px solid var(--border);
  border-radius: 8px;
  background: var(--gray-50);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  min-height: 200px;
  overflow-y: auto;
  max-height: 400px;
}

.preview-box .ts {
  color: var(--navy);
  font-weight: 500;
}

.preview-box .div-line {
  color: var(--text-muted);
}

/* Stat Row */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--gray-50);
  border-radius: 6px;
  padding: 10px 12px;
  text-align: center;
}

.stat-card .sv {
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
}

.stat-card .sk {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Actions */
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

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

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

.btn:active {
  transform: scale(.98);
}

.btn-p {
  background: var(--navy);
  color: var(--white);
  border-color: transparent;
}

.btn-p:hover {
  opacity: .82;
}

/* Toast */
.toast {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  background: #22c55e;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  opacity: 0;
  transition: opacity .2s;
  margin-left: 8px;
}

.toast.show {
  opacity: 1;
}

/* 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;
}