/* ═══════════════════════════════════════════════
   TOOL.CSS — Shared styles for all tool pages
   Uses same design tokens as style.css
═══════════════════════════════════════════════ */

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  color: rgba(255,255,255,.5);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.breadcrumb a { color: rgba(255,255,255,.6); transition: color .2s; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span:not(:last-child) { opacity: .5; }

/* ── Page Hero ── */
.page-hero {
  background: linear-gradient(160deg, var(--dark) 0%, #2A2A42 100%);
  padding: 44px 0 48px;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  width: 500px; height: 300px;
  background: radial-gradient(ellipse, rgba(212,97,26,.15) 0%, transparent 70%);
  top: -60px; right: -80px;
  pointer-events: none;
}
.page-hero-title {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  line-height: 1.2;
}
.page-hero-sub {
  max-width: 640px;
  color: rgba(255,255,255,.65);
  font-size: .97rem;
  line-height: 1.7;
}

/* ── Active nav link ── */
.active-link {
  color: var(--primary) !important;
}

/* ── Tool Section wrapper ── */
.tool-section {
  padding: 44px 0 56px;
}
.tool-wrapper {
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  box-shadow: var(--shadow-md);
}

/* ─────────────────────────────────────────────
   KEYWORD PHRASE MAKER — Sidebar Layout
───────────────────────────────────────────── */

/* Main 2-col layout */
.kpm-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 20px;
  align-items: start;
}

/* LEFT column */
.kpm-left {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 3 inputs row */
.kpm-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}
.kpm-box { display: flex; flex-direction: column; gap: 7px; }
.kpm-label {
  font-family: 'Poppins', sans-serif;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
}
.optional {
  font-weight: 400;
  color: var(--text-muted);
  font-size: .78rem;
}
.kpm-textarea {
  width: 100%;
  height: 200px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: .87rem;
  color: var(--text);
  background: var(--bg);
  resize: vertical;
  outline: none;
  line-height: 1.6;
  transition: border-color .2s;
}
.kpm-textarea:focus { border-color: var(--primary); background: #fff; }
.kpm-textarea::placeholder { color: #bbb; font-size: .81rem; }

/* Results (always visible, placeholder text) */
.kpm-results { display: flex; flex-direction: column; gap: 8px; }
.results-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.results-title {
  font-family: 'Poppins', sans-serif;
  font-size: .92rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.results-count {
  font-size: .75rem;
  background: #E6F4EA;
  color: #2E7D32;
  padding: 2px 10px;
  border-radius: 100px;
  font-weight: 700;
}
.results-textarea {
  width: 100%;
  height: 180px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: 'Inter', monospace;
  font-size: .85rem;
  color: var(--text);
  background: var(--bg);
  resize: vertical;
  outline: none;
  line-height: 1.7;
}
.results-textarea::placeholder { color: #bbb; font-style: italic; }

/* Error */
.tool-error {
  background: #FEE8E8;
  color: #C62828;
  border: 1px solid #FFCDD2;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: .87rem;
}

/* RIGHT sidebar */
.kpm-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 68px;
}

/* Options cards */
.kpm-options-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.options-title {
  font-family: 'Poppins', sans-serif;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #fff;
  background: var(--dark);
  padding: 8px 14px;
  display: block;
  margin: 0;
}
.kpm-options-card .radio-label,
.kpm-options-card .check-label {
  padding: 6px 14px;
}

/* Radio labels */
.radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .87rem;
  color: var(--text);
  cursor: pointer;
  transition: background .15s;
}
.radio-label:hover { background: rgba(0,0,0,.03); }
.radio-label input[type="radio"] {
  accent-color: var(--primary);
  width: 15px; height: 15px;
  cursor: pointer;
}

/* Checkbox labels */
.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .87rem;
  color: var(--text);
  cursor: pointer;
  transition: background .15s;
  flex-wrap: wrap;
}
.check-label:hover { background: rgba(0,0,0,.03); }
.check-label input[type="checkbox"] {
  accent-color: var(--primary);
  width: 15px; height: 15px;
  cursor: pointer;
  flex-shrink: 0;
}
.select-all-label { font-weight: 600; }
.check-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.match-example {
  font-size: .7rem;
  background: var(--primary-lt);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  margin-left: auto;
}

/* Buttons */
.btn-generate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px 16px;
  font-family: 'Poppins', sans-serif;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .15s;
  width: 100%;
}
.btn-generate:hover { background: var(--primary-dk); transform: translateY(-1px); }
.btn-generate:active { transform: translateY(0); }

.btn-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--dark);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: .87rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: .2s;
  width: 100%;
}
.btn-copy:hover { background: var(--dark-2); }
.btn-copy.copied { background: #2E7D32; }

.btn-clear {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: .87rem;
  cursor: pointer;
  transition: .2s;
  width: 100%;
}
.btn-clear:hover { border-color: #bbb; color: var(--text); }


/* ─────────────────────────────────────────────
   CASE MAKER
───────────────────────────────────────────── */
.cm-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 20px;
  align-items: start;
}

.cm-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cm-box { display: flex; flex-direction: column; gap: 7px; }

.cm-label {
  font-family: 'Poppins', sans-serif;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cm-active-case {
  font-size: .78rem;
  font-weight: 500;
  color: var(--primary);
  font-family: 'Inter', sans-serif;
}

.cm-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.output-textarea {
  background: var(--bg) !important;
  min-height: 200px !important;
}

/* cm-layout specific textarea heights */
.cm-layout .cc-textarea {
  min-height: 200px;
}
.cm-layout .cc-textarea-wrap:focus-within {
  border-color: var(--primary);
  background: #fff;
}

/* Right sidebar */
.cm-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 60px;
}

/* Case buttons */
.case-btn {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  cursor: pointer;
  text-align: left;
  transition: background .15s;
}
.case-btn:last-child { border-bottom: none; }
.case-btn:hover { background: rgba(212,97,26,.06); }
.case-btn.active { background: var(--primary-lt); }
.case-btn.active .case-btn-name { color: var(--primary); }

.case-btn-name {
  font-family: 'Poppins', sans-serif;
  font-size: .84rem;
  font-weight: 600;
  color: var(--text);
  transition: color .15s;
}
.case-btn-preview {
  font-size: .74rem;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
}
.content-section {
  background: var(--bg);
  padding: 56px 0;
  border-top: 1px solid var(--border);
}
.content-narrow {
  max-width: 800px;
}
.content-narrow h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 40px;
  margin-bottom: 14px;
}
.content-narrow h2:first-child { margin-top: 0; }
.content-narrow p {
  color: var(--text-muted);
  line-height: 1.75;
  font-size: .93rem;
  margin-bottom: 14px;
}
.how-steps {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}
.how-steps li {
  color: var(--text-muted);
  font-size: .93rem;
  line-height: 1.7;
  padding-left: 6px;
}
.how-steps li strong { color: var(--text); }

/* Match type table */
.match-type-table {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin: 20px 0;
}
.mtt-row {
  display: grid;
  grid-template-columns: 160px 120px 1fr;
  gap: 0;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
}
.mtt-row:last-child { border-bottom: none; }
.mtt-row span {
  padding: 12px 16px;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  line-height: 1.5;
}
.mtt-row span:last-child { border-right: none; }
.mtt-head {
  background: var(--dark);
}
.mtt-head span {
  color: rgba(255,255,255,.7);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-color: rgba(255,255,255,.1);
}
.mtt-row code {
  background: var(--primary-lt);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: .82rem;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 16px;
}
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: none;
  border: none;
  padding: 16px 20px;
  font-family: 'Poppins', sans-serif;
  font-size: .92rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background .2s;
}
.faq-q:hover { background: var(--bg); }
.faq-q svg { flex-shrink: 0; transition: transform .25s; color: var(--text-muted); }
.faq-item.open .faq-q svg { transform: rotate(180deg); }
.faq-item.open .faq-q { color: var(--primary); background: var(--primary-lt); }
.faq-item.open .faq-q svg { color: var(--primary); }
.faq-a {
  display: none;
  padding: 0 20px 16px;
  background: var(--bg);
}
.faq-item.open .faq-a { display: block; }
.faq-a p {
  font-size: .9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
  padding-top: 8px;
}

/* ── Related tools grid ── */
.related-section {
  padding: 56px 0;
  border-top: 1px solid var(--border);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 32px;
}


/* ─────────────────────────────────────────────
   RESPONSIVE — Tool pages
───────────────────────────────────────────── */
@media (max-width: 900px) {
  .kpm-layout { grid-template-columns: 1fr; }
  .kpm-right { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .btn-generate, .btn-copy, .btn-clear { grid-column: auto; }
  .kpm-inputs { grid-template-columns: 1fr 1fr 1fr; }
  .mtt-row { grid-template-columns: 140px 100px 1fr; }
  .cm-layout { grid-template-columns: 1fr; }
  .cm-right { position: static; }
  .cc-layout { grid-template-columns: 1fr; }
  .cc-right { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .cc-big-stat { grid-column: auto; }
}

@media (max-width: 640px) {
  .tool-wrapper { padding: 18px 14px; }
  .kpm-inputs { grid-template-columns: 1fr; }
  .kpm-right { grid-template-columns: 1fr; }
  .mtt-row { grid-template-columns: 1fr; }
  .mtt-row span { border-right: none; border-bottom: 1px solid var(--border); }
  .mtt-row span:last-child { border-bottom: none; }
  .page-hero { padding: 28px 0 32px; }
  .cc-right { grid-template-columns: 1fr; }
  .lt-row { grid-template-columns: 1fr 80px; }
}


/* ─────────────────────────────────────────────
   CHARACTER COUNT
───────────────────────────────────────────── */
.cc-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 20px;
  align-items: start;
}

/* Left — big textarea */
.cc-left { display: flex; flex-direction: column; }

.cc-textarea-wrap {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  transition: border-color .2s;
}
.cc-textarea-wrap:focus-within { border-color: var(--primary); background: #fff; }

.cc-textarea {
  width: 100%;
  min-height: 420px;
  padding: 16px;
  border: none;
  outline: none;
  font-family: 'Inter', sans-serif;
  font-size: .93rem;
  color: var(--text);
  background: transparent;
  resize: vertical;
  line-height: 1.7;
  display: block;
}
.cc-textarea::placeholder { color: #bbb; }

.cc-textarea-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
}
.cc-live-badge { font-size: .75rem; color: #2E7D32; font-weight: 600; }
.cc-clear-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: .78rem;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: .2s;
}
.cc-clear-btn:hover { border-color: #bbb; color: var(--text); }

/* Right sidebar */
.cc-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 60px;
}

/* Big stat blocks */
.cc-big-stat {
  background: var(--primary);
  border-radius: 12px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}
.cc-big-stat.secondary {
  background: var(--dark);
}
.cc-big-num {
  font-family: 'Poppins', sans-serif;
  font-size: 2.4rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.cc-big-label {
  font-size: .78rem;
  color: rgba(255,255,255,.8);
  font-weight: 500;
  line-height: 1.4;
}
.cc-big-label em { font-style: normal; opacity: .7; font-size: .72rem; display: block; }

/* Stat rows card */
.cc-stat-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.cc-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  font-size: .86rem;
}
.cc-stat-row:last-child { border-bottom: none; }
.cc-stat-row-label { color: var(--text-muted); }
.cc-stat-row-val {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  color: var(--text);
}

/* Limits table */
.limits-table {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin: 20px 0;
}
.lt-row {
  display: grid;
  grid-template-columns: 1fr 100px;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
}
.lt-row:last-child { border-bottom: none; }
.lt-row span { padding: 10px 16px; color: var(--text-muted); }
.lt-row span:last-child { text-align: right; font-weight: 700; color: var(--text); }
.lt-head { background: var(--dark); }
.lt-head span { color: rgba(255,255,255,.7); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.lt-head span:last-child { color: rgba(255,255,255,.7); }


/* ─────────────────────────────────────────────
   SIMPLE ACTION CARD (Upper/Lower tools)
───────────────────────────────────────────── */
.simple-action-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}
.sac-icon { font-size: 2rem; }
.sac-desc { font-size: .8rem; color: var(--text-muted); line-height: 1.5; }
.sac-example {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.sac-before {
  font-family: 'Poppins', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--border);
  padding: 3px 8px;
  border-radius: 5px;
}
.sac-after {
  font-family: 'Poppins', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-lt);
  padding: 3px 8px;
  border-radius: 5px;
}

/* ─────────────────────────────────────────────
   NOTEPAD ONLINE
───────────────────────────────────────────── */
.np-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 20px;
  align-items: start;
}

.np-left {
  display: flex;
  flex-direction: column;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  transition: border-color .2s;
}
.np-left:focus-within { border-color: var(--primary); }

/* Toolbar */
.np-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: var(--dark);
  gap: 12px;
}
.np-toolbar-left { display: flex; align-items: center; gap: 10px; }
.np-toolbar-right { display: flex; align-items: center; gap: 8px; }

.np-autosave {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .75rem;
  color: #7AE28C;
  font-weight: 600;
}

.np-font-label { font-size: .75rem; color: rgba(255,255,255,.5); }
.np-font-select {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 6px;
  color: #fff;
  font-size: .78rem;
  padding: 3px 8px;
  cursor: pointer;
  font-family: inherit;
  outline: none;
}
.np-font-select option { background: var(--dark); color: #fff; }

/* Main textarea */
.np-textarea {
  width: 100%;
  min-height: 460px;
  padding: 18px;
  border: none;
  outline: none;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: var(--text);
  background: transparent;
  resize: vertical;
  line-height: 1.75;
}
.np-textarea::placeholder { color: #ccc; }

/* Footer */
.np-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  font-size: .75rem;
  color: var(--text-muted);
}

/* Right sidebar */
.np-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 60px;
}

.np-info-card {
  background: var(--primary-lt);
  border: 1.5px solid rgba(212,97,26,.2);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}
.np-info-icon { font-size: 1.8rem; margin-bottom: 8px; }
.np-info-card h3 {
  font-family: 'Poppins', sans-serif;
  font-size: .88rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}
.np-info-card p {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.np-stats-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

@media (max-width: 900px) {
  .np-layout { grid-template-columns: 1fr; }
  .np-right { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .np-info-card { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .np-right { grid-template-columns: 1fr; }
  .np-textarea { min-height: 320px; }
}

/* ─────────────────────────────────────────────
   PALINDROME CHECKER
───────────────────────────────────────────── */
.pc-result-box {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  min-height: 90px;
}

.pc-result-idle {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  color: var(--text-muted);
  font-size: .9rem;
}
.pc-result-idle p { margin: 0; }

.pc-result {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}
.pc-result strong {
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}
.pc-result p { font-size: .86rem; color: var(--text-muted); margin: 0; }

.pc-result-icon { font-size: 2rem; flex-shrink: 0; }

.pc-result.yes {
  background: #E6F4EA;
  border-color: #A5D6A7;
}
.pc-result.yes strong { color: #2E7D32; }

.pc-result.no {
  background: #FEE8E8;
  border-color: #FFCDD2;
}
.pc-result.no strong { color: #C62828; }

/* Examples card */
.pc-examples-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.pc-examples-card h4 {
  font-family: 'Poppins', sans-serif;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.pc-example-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 8px 6px;
  font-size: .82rem;
  color: var(--primary);
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pc-example-btn:last-child { border-bottom: none; }
.pc-example-btn:hover { background: var(--primary-lt); }

/* ─────────────────────────────────────────────
   SMALL CAPS GENERATOR
───────────────────────────────────────────── */
.sc-preview-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.sc-preview-card h4 {
  font-family: 'Poppins', sans-serif;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.sc-alpha-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
}
.sc-alpha-row span {
  font-size: .72rem;
  color: var(--text-muted);
  font-family: monospace;
  padding: 2px 4px;
}

/* ─────────────────────────────────────────────
   JSON-LD GENERATOR
───────────────────────────────────────────── */
.jld-type-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.jld-type-btn {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background: var(--bg-white);
  color: var(--text-muted);
  font-size: .84rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: .2s;
}
.jld-type-btn:hover { border-color: var(--primary); color: var(--primary); }
.jld-type-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.jld-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

/* Form column */
.jld-form-col { display: flex; flex-direction: column; }
.jld-form { display: flex; flex-direction: column; gap: 12px; }
.jld-form-title {
  font-family: 'Poppins', sans-serif;
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 4px;
}

.jld-field { display: flex; flex-direction: column; gap: 5px; }
.jld-field label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.jld-field input,
.jld-field select,
.jld-field textarea {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: .87rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color .2s;
  width: 100%;
}
.jld-field input:focus,
.jld-field select:focus,
.jld-field textarea:focus { border-color: var(--primary); background: #fff; }
.jld-field textarea { resize: vertical; }

.faq-pair {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.jld-add-btn {
  background: none;
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  padding: 9px;
  font-family: inherit;
  font-size: .84rem;
  color: var(--primary);
  cursor: pointer;
  transition: .2s;
  font-weight: 600;
}
.jld-add-btn:hover { background: var(--primary-lt); border-color: var(--primary); }

/* Output column */
.jld-output-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 60px;
}
.jld-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.jld-output-label {
  font-family: 'Poppins', sans-serif;
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
}
.jld-output-textarea {
  width: 100%;
  min-height: 420px;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: 'Courier New', monospace;
  font-size: .8rem;
  color: var(--text);
  background: var(--dark);
  color: #7AE28C;
  resize: vertical;
  outline: none;
  line-height: 1.6;
}
.jld-output-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.jld-output-tip svg { flex-shrink: 0; margin-top: 2px; }
.jld-output-tip code {
  background: var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: .75rem;
}

@media (max-width: 900px) {
  .jld-layout { grid-template-columns: 1fr; }
  .jld-output-col { position: static; }
}

/* ─────────────────────────────────────────────
   CALCULATOR
───────────────────────────────────────────── */
.calc-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  align-items: start;
  justify-content: center;
}

.calc-wrap {
  background: var(--dark);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}

/* Display */
.calc-display {
  padding: 20px 20px 12px;
  text-align: right;
  background: var(--dark);
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.calc-expression {
  font-size: .82rem;
  color: rgba(255,255,255,.4);
  min-height: 20px;
  margin-bottom: 4px;
  font-family: 'Inter', sans-serif;
}
.calc-result {
  font-family: 'Poppins', sans-serif;
  font-size: 2.6rem;
  font-weight: 300;
  color: #fff;
  line-height: 1;
  letter-spacing: -.02em;
  transition: font-size .1s;
  word-break: break-all;
}

/* Grid */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255,255,255,.06);
}

.calc-btn {
  background: #2D2D40;
  border: none;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 1.15rem;
  font-weight: 500;
  padding: 0;
  height: 72px;
  cursor: pointer;
  transition: background .12s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.calc-btn:hover    { background: #3A3A52; }
.calc-btn:active   { background: #4A4A62; transform: scale(.96); }

.calc-btn.fn       { background: #3A3A52; color: #fff; font-size: 1rem; }
.calc-btn.fn:hover { background: #4A4A62; }

.calc-btn.op       { background: var(--primary); font-size: 1.3rem; }
.calc-btn.op:hover { background: var(--primary-dk); }

.calc-btn.eq       { background: var(--primary); font-size: 1.3rem; }
.calc-btn.eq:hover { background: var(--primary-dk); }

.calc-btn.wide     { grid-column: span 2; justify-content: flex-start; padding-left: 28px; }

/* Extras row */
.calc-extras {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--dark);
  border-top: 1px solid rgba(255,255,255,.06);
}
.calc-extra-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 7px;
  color: rgba(255,255,255,.65);
  font-size: .78rem;
  padding: 5px 12px;
  cursor: pointer;
  font-family: inherit;
  transition: .2s;
}
.calc-extra-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.calc-keyboard-hint {
  font-size: .72rem;
  color: rgba(255,255,255,.3);
}

/* History panel */
.calc-history-col {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  max-height: 420px;
  display: flex;
  flex-direction: column;
}
.calc-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-white);
}
.calc-history-title {
  font-family: 'Poppins', sans-serif;
  font-size: .85rem;
  font-weight: 700;
  color: var(--text);
}
.calc-history-list {
  overflow-y: auto;
  flex: 1;
  padding: 8px 0;
}
.calc-history-empty {
  font-size: .84rem;
  color: var(--text-muted);
  padding: 20px 16px;
  text-align: center;
}
.calc-history-item {
  display: flex;
  flex-direction: column;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
}
.calc-history-item:last-child { border-bottom: none; }
.calc-history-item:hover { background: var(--primary-lt); }
.calc-history-expr {
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.calc-history-res {
  font-family: 'Poppins', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
}

@media (max-width: 900px) {
  .calc-layout { grid-template-columns: 1fr; justify-items: center; }
  .calc-history-col { width: 100%; max-height: 260px; }
  .calc-wrap { width: 100%; max-width: 360px; }
}
@media (max-width: 400px) {
  .calc-btn { height: 60px; font-size: 1rem; }
  .calc-result { font-size: 2rem; }
}