/* HappyNooks Text Tools 1.3.1 — professional utility workspace */
.hn-tool-shell[data-hn-module="HappyNooks Text Tools"] {
  --hn-text-accent: #15803d;
  --hn-text-accent-strong: #166534;
  --hn-text-soft: #edf9f0;
  --hn-text-line: #dce8df;
  max-width: 1120px;
  margin: 20px auto 32px !important;
  padding: clamp(18px, 3vw, 34px);
  border-color: #dfe7e2;
  background:
    radial-gradient(circle at 8% 0%, rgba(21, 128, 61, .075), transparent 32%),
    #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .08);
}

.hn-tool-shell[data-hn-module="HappyNooks Text Tools"] > .hn-tool-head {
  max-width: 760px;
  margin: 0 auto 26px;
}

.hn-tool-shell[data-hn-module="HappyNooks Text Tools"] > .hn-tool-head h2 {
  color: #0f172a;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -.035em;
  line-height: 1.08;
}

.hn-tool-shell[data-hn-module="HappyNooks Text Tools"] > .hn-tool-head p {
  color: #5c6b63;
  font-size: 16px;
}

.hn-text-tool {
  padding: 0;
  overflow: hidden;
  border: 1px solid #dce7df;
  border-radius: 24px;
  background: #f7faf8;
  box-shadow: 0 18px 46px rgba(15, 23, 42, .06);
}

.hn-text-tool .hn-utility-context {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid #dce7df;
  background: linear-gradient(135deg, #ffffff 0%, #f3faf5 100%);
}

.hn-text-tool .hn-utility-context-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid #bfe0c8;
  border-radius: 16px;
  background: #edf9f0;
  color: #166534;
  font-size: 16px;
  font-weight: 950;
  letter-spacing: -.04em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
}

.hn-text-tool .hn-utility-context-copy { min-width: 0; }
.hn-text-tool .hn-utility-eyebrow,
.hn-text-card-kicker {
  display: block;
  color: #15803d;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: .13em;
  line-height: 1.2;
}

.hn-text-tool .hn-utility-context-copy > strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 19px;
  line-height: 1.25;
}

.hn-text-tool .hn-utility-context-copy p {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}

.hn-text-tool .hn-utility-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.hn-text-tool .hn-utility-badges span {
  padding: 7px 10px;
  border: 1px solid #d8e5dc;
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  color: #42604a;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.hn-text-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr);
  gap: 18px;
  padding: 18px;
  align-items: stretch;
}

.hn-text-editor-card,
.hn-text-action-card,
.hn-text-result {
  border: 1px solid #dde7e0;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .045);
}

.hn-text-editor-card {
  min-width: 0;
  overflow: hidden;
  border-radius: 18px;
}

.hn-text-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 14px 16px;
  border-bottom: 1px solid #e7eee9;
  background: #fbfdfb;
}

.hn-text-card-head > div:first-child strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 15px;
}

.hn-text-quick-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.hn-text-quiet-btn,
.hn-text-tool .hn-text-secondary-btn,
.hn-text-tool .hn-copy-output {
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid #d8e4dc;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.hn-text-quiet-btn:hover,
.hn-text-tool .hn-text-secondary-btn:hover,
.hn-text-tool .hn-copy-output:hover,
.hn-text-tool .hn-copy-output.is-copied {
  border-color: #86c99a;
  background: #f2faf4;
  color: #166534;
  transform: translateY(-1px);
}

.hn-text-tool .hn-text-input {
  display: block;
  width: 100%;
  min-height: 390px;
  margin: 0;
  padding: 22px;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: #fff;
  color: #17211b;
  font-size: 16px;
  line-height: 1.72;
  resize: vertical;
  box-shadow: none;
}

.hn-text-tool .hn-text-input:focus {
  box-shadow: inset 0 0 0 2px rgba(21, 128, 61, .16);
}

.hn-text-tool .hn-text-input::placeholder { color: #94a3b8; }

.hn-text-live-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  min-height: 44px;
  padding: 10px 16px;
  border-top: 1px solid #e7eee9;
  background: #fbfdfb;
  color: #64748b;
  font-size: 12px;
}

.hn-text-live-strip strong { color: #0f172a; }

.hn-text-side-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

.hn-text-action-card {
  padding: 16px;
  border-radius: 18px;
}

.hn-text-actions {
  display: grid;
  gap: 10px;
  margin-top: 11px;
}

.hn-text-tool .hn-btn {
  width: 100%;
  min-height: 48px;
  border-radius: 13px;
  background: #15803d;
  box-shadow: 0 12px 24px rgba(21, 128, 61, .18);
}

.hn-text-tool .hn-btn:hover { background: #166534; }

.hn-text-button-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.hn-text-button-grid .hn-text-secondary-btn {
  min-height: 42px;
  text-align: center;
}

.hn-text-option-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.hn-text-option-row label {
  display: grid;
  gap: 6px;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.hn-text-option-row select {
  min-height: 43px !important;
  padding-top: 9px !important;
  padding-bottom: 9px !important;
  border-color: #d8e4dc !important;
  border-radius: 11px !important;
  background-color: #fff !important;
}

.hn-text-result {
  min-height: 278px;
  margin: 0;
  padding: 16px;
  overflow: hidden;
  border-radius: 18px;
  color: #0f172a;
}

.hn-text-result.success,
.hn-text-result.error {
  border-color: #dde7e0;
  background: #fff;
}

.hn-text-empty-result {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 245px;
  padding: 20px;
  text-align: center;
}

.hn-text-empty-result > span {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: #edf9f0;
  color: #15803d;
  font-size: 22px;
}

.hn-text-empty-result strong { font-size: 15px; }
.hn-text-empty-result p { margin: 5px 0 0; color: #64748b; font-size: 12px; line-height: 1.45; }

.hn-text-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.hn-text-result-head strong { display: block; color: #0f172a; font-size: 16px; }
.hn-text-result-head span { display: block; margin-top: 3px; color: #64748b; font-size: 11.5px; }

.hn-text-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.hn-text-stat {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e2e9e4;
  border-radius: 13px;
  background: #fbfdfb;
}

.hn-text-stat strong {
  display: block;
  color: #0f172a;
  font-size: 22px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.hn-text-stat span {
  display: block;
  margin-top: 5px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.3;
}

.hn-text-fact-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.hn-text-fact-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 10px;
  background: #f5f8f6;
  color: #64748b;
  font-size: 11.5px;
}

.hn-text-fact-list strong { color: #25312a; text-align: right; }

.hn-text-output-box {
  display: grid;
  gap: 10px;
}

.hn-text-output-box textarea,
.hn-text-output-box input {
  width: 100%;
  min-height: 105px;
  padding: 12px 13px;
  border: 1px solid #dce7df;
  border-radius: 12px;
  background: #fbfdfb;
  color: #17211b;
  font: inherit;
  font-size: 13px;
  line-height: 1.55;
  resize: vertical;
}

.hn-text-output-box input {
  min-height: 48px;
  resize: none;
}

.hn-meta-meter {
  height: 9px;
  margin: 12px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eee9;
}

.hn-meta-meter span {
  display: block;
  height: 100%;
  width: var(--hn-meta-progress, 0%);
  border-radius: inherit;
  background: #15803d;
  transition: width .2s ease, background .2s ease;
}

.hn-meta-meter.is-short span { background: #d97706; }
.hn-meta-meter.is-long span { background: #dc2626; }

.hn-meta-status {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #64748b;
  font-size: 11.5px;
}

.hn-meta-status strong { color: #0f172a; }

.hn-search-preview {
  margin-top: 13px;
  padding: 13px;
  border: 1px solid #e2e8f0;
  border-radius: 13px;
  background: #fff;
}

.hn-search-preview small { display: block; color: #15803d; font-size: 10.5px; }
.hn-search-preview strong { display: block; margin: 4px 0; color: #1d4ed8; font-size: 14px; line-height: 1.3; }
.hn-search-preview p { margin: 0; color: #4b5563; font-size: 11.5px; line-height: 1.45; overflow-wrap: anywhere; }

.hn-text-tool .hn-utility-privacy-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 18px 18px;
  padding: 12px 14px;
  border: 1px solid #dce7df;
  border-radius: 14px;
  background: #fff;
  color: #526159;
}

.hn-text-tool .hn-utility-privacy-note > span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  background: #edf9f0;
  color: #15803d;
  font-weight: 900;
}

.hn-text-tool .hn-utility-privacy-note p { margin: 0; font-size: 12px; line-height: 1.45; }
.hn-text-tool .hn-utility-privacy-note strong { color: #25312a; }

@media (max-width: 900px) {
  .hn-text-workspace { grid-template-columns: 1fr; }
  .hn-text-side-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; }
  .hn-text-result { min-height: 240px; }
}

@media (max-width: 680px) {
  .hn-tool-shell[data-hn-module="HappyNooks Text Tools"] { margin: 14px auto 24px !important; padding: 12px; border-radius: 18px; }
  .hn-text-tool { border-radius: 18px; }
  .hn-text-tool .hn-utility-context { grid-template-columns: auto minmax(0, 1fr); padding: 16px; }
  .hn-text-tool .hn-utility-badges { grid-column: 1 / -1; justify-content: flex-start; }
  .hn-text-workspace { padding: 12px; gap: 12px; }
  .hn-text-side-panel { grid-template-columns: 1fr; }
  .hn-text-card-head { align-items: flex-start; flex-direction: column; }
  .hn-text-quick-actions { width: 100%; }
  .hn-text-quick-actions button { flex: 1; }
  .hn-text-tool .hn-text-input { min-height: 310px; padding: 16px; }
  .hn-text-tool .hn-utility-privacy-note { margin: 0 12px 12px; }
}

@media (max-width: 430px) {
  .hn-text-tool .hn-utility-context-icon { width: 44px; height: 44px; border-radius: 13px; }
  .hn-text-button-grid,
  .hn-text-stat-grid { grid-template-columns: 1fr; }
  .hn-text-result-head { align-items: stretch; flex-direction: column; }
  .hn-text-result-head .hn-copy-output { width: 100%; }
}
