/* WhatsApp Font Formatter Custom Styles */
.wa-tool-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 0 24px;
}

.wa-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

@media (max-width: 700px) {
  .wa-grid {
    grid-template-columns: 1fr;
  }
}

.wa-left, .wa-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

/* Card */
.card {
  background: var(--white);
  border: .5px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}

/* Format Bar */
.fmtbar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ftb {
  width: 34px;
  height: 34px;
  border: .5px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: background .12s;
}

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

.ftb.on {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.ftb-bold { font-weight: 700; }
.ftb-italic { font-style: italic; }
.ftb-strike { text-decoration: line-through; }
.ftb-mono { font-family: monospace; }

/* Textarea */
textarea#editor {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  font-size: 14px;
  line-height: 1.6;
  padding: 10px 12px;
  border: .5px solid var(--border);
  border-radius: 6px;
  background: var(--gray-50);
  color: var(--text);
  font-family: inherit;
}

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

/* Output Raw */
.output-raw {
  width: 100%;
  min-height: 80px;
  font-family: monospace;
  font-size: 12px;
  line-height: 1.6;
  padding: 10px 12px;
  background: var(--gray-50);
  border: .5px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-all;
  margin-top: 12px;
}

/* Action Row */
.action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

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

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

.abtn.primary {
  background: #075E54;
  color: #fff;
  border-color: #075E54;
}

.abtn.primary:hover {
  background: #065c4a;
}

/* Cheatsheet */
.cheatsheet-section {
  margin-top: 8px;
}

.cheatsheet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.cs-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--gray-50);
  border-radius: 6px;
  cursor: pointer;
  border: .5px solid var(--border);
  transition: border-color .12s;
}

.cs-row:hover {
  border-color: var(--gray-400);
}

.cs-tag {
  font-family: monospace;
  font-size: 11px;
  color: var(--text-muted);
  min-width: 55px;
}

.cs-pre {
  font-size: 13px;
  color: var(--text);
}

.cs-pre b { font-weight: 700; }
.cs-pre i { font-style: italic; }
.cs-pre s { text-decoration: line-through; }
.cs-pre code {
  font-family: monospace;
  background: var(--gray-100);
  padding: 0 4px;
  border-radius: 3px;
  font-size: 12px;
}

/* Phone Preview */
.phone-wrap {
  background: var(--gray-50);
  border-radius: 8px;
  overflow: hidden;
}

.phone-top {
  background: #075E54;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.phone-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #25D366;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
}

.phone-name {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
}

.phone-sub {
  font-size: 11px;
  color: #B2DFDB;
}

.chat-area {
  background: #ECE5DD;
  min-height: 160px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bubble {
  max-width: 82%;
  padding: 8px 10px 6px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  align-self: flex-end;
  background: #DCF8C6;
}

.bubble .ts {
  font-size: 10px;
  color: #667781;
  text-align: right;
  margin-top: 3px;
}

.bubble-in {
  align-self: flex-start;
  background: #fff;
}

.phone-bot {
  background: #ECE5DD;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #D9D9D9;
}

.phone-inp {
  flex: 1;
  background: #fff;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 13px;
  color: #aaa;
}

/* Template Section */
.template-section {
  margin-top: 8px;
}

.template-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.template-list .cs-row {
  flex-direction: column;
  align-items: flex-start;
}

.cs-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.cs-preview {
  font-size: 13px;
  color: var(--text-muted);
}

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