/* ---------------------------------------------------------------------------
   LinkedIn Post Formatter — tool styles
   Loaded after css/styles.css by free-linkedin-post-formatter.html.
   Everything is scoped under .lf-shell (plus the prefixed explainer helper
   .lf-sep-preview). No Tailwind utilities are introduced, so the compiled
   stylesheet needs no rebuild.
   --------------------------------------------------------------------------- */

.lf-shell{
  --lf-ink:#211b32;
  --lf-ink-soft:#625c70;
  --lf-ink-mute:#6b6478;
  --lf-primary:#9181FF;
  --lf-primary-dark:#6a5ae0;
  --lf-primary-deep:#5b4bd4;
  --lf-primary-light:#a799ff;
  --lf-line:#e4e0eb;
  --lf-line-soft:#ece9f1;
  --lf-line-strong:#c9c1d9;
  --lf-tint:#f7f5fb;
  --lf-tint-strong:#f0edff;
  --lf-mono:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;
  max-width:100%;
  color:var(--lf-ink);
  font-family:Inter,"Segoe UI",system-ui,-apple-system,sans-serif;
  font-size:15px;
  line-height:1.65;
  overflow-wrap:break-word;
}

.lf-shell *,
.lf-shell *::before,
.lf-shell *::after{box-sizing:border-box}

.lf-shell [hidden],
.lf-hidden{display:none!important}

.lf-shell button,
.lf-shell input,
.lf-shell select,
.lf-shell textarea{font:inherit;color:inherit}

.lf-shell :focus-visible{outline:3px solid var(--lf-primary);outline-offset:2px}

/* --- layout ---------------------------------------------------------------- */

.lf-shell .lf-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:20px;
  align-items:start;
}

.lf-shell .lf-pane{
  min-width:0;
  padding:22px;
  border:1px solid var(--lf-line);
  border-radius:16px;
  background:#fff;
  box-shadow:0 1px 2px rgba(33,27,50,.04);
}

.lf-shell .lf-pane-head{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:6px 14px;
  margin-bottom:4px;
}

.lf-shell .lf-pane-title{
  margin:0;
  font-size:15px;
  font-weight:700;
  letter-spacing:.01em;
  color:#2a2140;
}

.lf-shell .lf-count{
  font-size:12.5px;
  color:var(--lf-ink-mute);
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}

.lf-shell .lf-actions{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  margin-top:12px;
}

.lf-shell .lf-toolbar{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
  margin:0 0 18px;
  padding:12px 14px;
  border:1px solid var(--lf-line);
  border-radius:12px;
  background:var(--lf-tint);
}

.lf-shell .lf-toolbar .lf-btn{min-height:40px;padding:8px 13px;font-size:13px}
.lf-shell .lf-toolbar .lf-btn-fix{
  flex:0 1 auto;
  min-height:54px;
  padding:14px 26px;
  border:0;
  border-radius:12px;
  font-size:16px;
}
.lf-shell .lf-toolbar .lf-hint{margin:0}

/* --- buttons --------------------------------------------------------------- */

.lf-shell .lf-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.45em;
  min-height:44px;
  padding:10px 16px;
  border:1px solid var(--lf-line-strong);
  border-radius:10px;
  background:#fff;
  color:#3b2f5e;
  font-size:14px;
  font-weight:600;
  line-height:1.2;
  text-align:center;
  text-decoration:none;
  cursor:pointer;
  transition:background-color .18s ease,border-color .18s ease,color .18s ease,transform .12s ease,box-shadow .18s ease;
}

.lf-shell .lf-btn:hover{background:var(--lf-tint);border-color:#b9aede}
.lf-shell .lf-btn:active{transform:scale(.98)}
.lf-shell .lf-btn:disabled{opacity:.45;cursor:default;transform:none}

.lf-shell .lf-btn-primary{
  border-color:var(--lf-primary-dark);
  background:var(--lf-primary-dark);
  color:#fff;
}
.lf-shell .lf-btn-primary:hover{background:var(--lf-primary-deep);border-color:var(--lf-primary-deep)}

.lf-shell .lf-btn-ghost{
  border-color:var(--lf-line);
  background:#fff;
  color:var(--lf-ink-soft);
}
.lf-shell .lf-btn-ghost:hover{background:var(--lf-tint);color:#3b2f5e}

.lf-shell .lf-btn-fix{
  flex:1 1 auto;
  min-height:54px;
  padding:14px 26px;
  border:0;
  border-radius:12px;
  background:linear-gradient(135deg,var(--lf-primary-dark) 0%,#5f4fd6 55%,var(--lf-primary-deep) 100%);
  color:#fff;
  font-size:16px;
  font-weight:700;
  letter-spacing:.01em;
  box-shadow:0 10px 24px -8px rgba(122,106,238,.65),inset 0 2px 0 rgba(255,255,255,.14);
}
.lf-shell .lf-btn-fix:hover{
  transform:translateY(-1px);
  box-shadow:0 14px 30px -8px rgba(122,106,238,.75),inset 0 2px 0 rgba(255,255,255,.14);
}
.lf-shell .lf-btn-fix:active{transform:translateY(0) scale(.99)}

/* --- editor ---------------------------------------------------------------- */

.lf-shell .lf-textarea{
  display:block;
  width:100%;
  min-height:260px;
  margin:10px 0 0;
  padding:14px 16px;
  border:1px solid var(--lf-line-strong);
  border-radius:12px;
  background:#fff;
  color:var(--lf-ink);
  font-family:var(--lf-mono);
  font-size:14px;
  line-height:1.75;
  resize:vertical;
  overflow-wrap:break-word;
  transition:border-color .18s ease,box-shadow .18s ease;
}

.lf-shell .lf-textarea:focus{
  border-color:var(--lf-primary);
  box-shadow:0 0 0 3px rgba(145,129,255,.18);
}

.lf-shell .lf-textarea::placeholder{
  color:#5a5464;
  opacity:1;
}

.lf-shell .lf-textarea-out{
  background:#fbfaff;
  border-color:#ddd6ff;
  box-shadow:inset 0 1px 2px rgba(33,27,50,.04);
}

.lf-shell .lf-textarea-sm{
  min-height:120px;
  font-size:13px;
  line-height:1.7;
}

/* --- controls -------------------------------------------------------------- */

.lf-shell .lf-controls{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:12px 14px;
  margin-top:18px;
}

.lf-shell .lf-control{
  display:flex;
  flex-direction:column;
  gap:5px;
  min-width:0;
}

/* Select controls form an even two-column grid (four selects = a clean 2x2 at
   1024/1280/1440). The checkbox grid is the pane's last .lf-controls and keeps
   its auto-fit columns. An odd number of select controls lets the final one
   span the row so no half-width orphan is left behind. */
@media (min-width:701px){
  .lf-shell .lf-controls{grid-template-columns:repeat(2,minmax(0,1fr))}
  .lf-shell .lf-controls:last-of-type{grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}
  .lf-shell .lf-controls > .lf-control:last-child:nth-child(odd){grid-column:1/-1}
}

.lf-shell .lf-label{
  font-size:12.5px;
  font-weight:700;
  letter-spacing:.01em;
  color:var(--lf-ink-soft);
}

.lf-shell .lf-select{
  width:100%;
  min-height:42px;
  padding:9px 11px;
  border:1px solid var(--lf-line-strong);
  border-radius:9px;
  background:#fff;
  color:var(--lf-ink);
  font-size:14px;
  cursor:pointer;
}

.lf-shell .lf-check{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:32px;
  font-size:13.5px;
  color:#3b2f5e;
  cursor:pointer;
  user-select:none;
}

.lf-shell .lf-check input{
  flex:0 0 auto;
  width:16px;
  height:16px;
  margin:0;
  accent-color:var(--lf-primary-dark);
  cursor:pointer;
}

/* --- reports --------------------------------------------------------------- */

.lf-shell .lf-subcard{
  min-width:0;
  margin-top:18px;
  padding:16px 18px;
  border:1px solid var(--lf-line);
  border-radius:12px;
  background:var(--lf-tint);
}

.lf-shell .lf-subcard-title{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:6px 12px;
  margin:0 0 8px;
  font-size:13px;
  font-weight:700;
  color:#3b2f5e;
}

.lf-shell .lf-report{
  display:grid;
  gap:8px;
  margin-top:12px;
  font-size:13.5px;
  color:var(--lf-ink-soft);
}

.lf-shell .lf-report-row{
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  gap:4px 12px;
  padding:8px 11px;
  border:1px solid var(--lf-line-soft);
  border-radius:9px;
  background:#fff;
  font-size:13px;
  line-height:1.5;
  overflow-wrap:anywhere;
}

/* Counts added to report rows (e.g. "4 dashes replaced") stay right-aligned
   even when the label wraps to a second line. */
.lf-shell .lf-report-row .lf-count{margin-left:auto;font-size:12px}

.lf-shell .lf-ai-list{
  display:grid;
  gap:6px;
  max-height:360px;
  margin:12px 0 0;
  padding:0;
  overflow-y:auto;
  overscroll-behavior:contain;
  list-style:none;
}

.lf-shell .lf-ai-row{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px 10px;
  padding:7px 10px;
  border:1px solid var(--lf-line-soft);
  border-radius:8px;
  background:#fff;
  font-size:12.5px;
  transition:background-color .15s ease,border-color .15s ease;
}

.lf-shell .lf-ai-row:hover{background:#faf9ff;border-color:#ddd6ff}

.lf-shell .lf-diff{
  display:inline-flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px;
  min-width:0;
  max-width:100%;
}

.lf-shell .lf-ai-from,
.lf-shell .lf-ai-row code{
  padding:1px 6px;
  border-radius:4px;
  background:#fce9e7;
  color:#8a3a30;
  font-family:var(--lf-mono);
  font-size:12px;
  overflow-wrap:anywhere;
}

.lf-shell .lf-ai-to,
.lf-shell .lf-ai-row strong{
  padding:1px 6px;
  border-radius:4px;
  background:#e3f5e9;
  color:#1b6235;
  font-family:var(--lf-mono);
  font-size:12px;
  font-weight:600;
  overflow-wrap:anywhere;
}

.lf-shell .lf-ai-row .lf-check{
  min-height:0;
  margin-left:auto;
  gap:5px;
  font-size:11.5px;
  color:var(--lf-ink-mute);
}

.lf-shell .lf-ai-row .lf-check input{width:14px;height:14px}

.lf-shell .lf-pre{
  max-width:100%;
  margin:8px 0 0;
  padding:12px 13px;
  border:1px solid var(--lf-line);
  border-radius:9px;
  background:#fff;
  color:var(--lf-ink);
  font-family:var(--lf-mono);
  font-size:13px;
  line-height:1.7;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}

.lf-shell .lf-copyrow{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  margin-top:10px;
}

.lf-shell .lf-warn{
  display:grid;
  gap:4px;
  margin:16px 0 0;
  padding:11px 14px;
  border:1px solid #f0d9a8;
  border-radius:10px;
  background:#fff8e6;
  color:#6b4e13;
  font-size:13px;
  line-height:1.5;
}

.lf-shell .lf-warn-item{
  display:flex;
  align-items:flex-start;
  gap:8px;
  overflow-wrap:anywhere;
}

.lf-shell .lf-warn-item::before{
  content:"";
  flex:0 0 auto;
  width:6px;
  height:6px;
  margin-top:.55em;
  border-radius:50%;
  background:#c79a2e;
}

.lf-shell .lf-status{
  min-height:1.4em;
  margin:16px 0 0;
  font-size:13.5px;
  font-weight:600;
  color:#5b43b8;
}

.lf-shell .lf-badge{
  display:inline-flex;
  align-items:center;
  gap:.3em;
  padding:3px 9px;
  border:1px solid #ddd6ff;
  border-radius:999px;
  background:var(--lf-tint-strong);
  color:#5b43b8;
  font-size:11.5px;
  font-weight:700;
  letter-spacing:.02em;
  white-space:nowrap;
}

.lf-shell .lf-hint{
  margin:8px 0 0;
  font-size:12.5px;
  line-height:1.5;
  color:var(--lf-ink-mute);
}

/* A one-line explainer under a select wraps inside its own column instead of
   pushing the neighbouring control. Placed directly in the grid it spans both
   columns so it never takes a select's cell. */
.lf-shell .lf-control .lf-hint{
  margin-top:2px;
  font-size:12px;
  line-height:1.45;
  overflow-wrap:break-word;
}
.lf-shell .lf-controls > .lf-hint{grid-column:1/-1;margin:0}

/* --- explainer helper (used outside .lf-shell too) ------------------------- */

.lf-sep-preview{
  display:block;
  width:100%;
  max-width:260px;
  height:1.6em;
  margin:10px 0;
  border-bottom:2px dotted var(--lf-primary-dark,#6a5ae0);
  border-radius:2px;
  background:repeating-linear-gradient(90deg,rgba(145,129,255,.14) 0 6px,transparent 6px 12px);
}

/* --- responsive / motion --------------------------------------------------- */

@media (min-width:1024px){
  .lf-shell .lf-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:24px;
  }
}

@media (max-width:700px){
  .lf-shell .lf-pane{padding:16px}
  .lf-shell .lf-controls{grid-template-columns:1fr}
  .lf-shell .lf-actions,
  .lf-shell .lf-copyrow{gap:10px}
  .lf-shell .lf-actions .lf-btn,
  .lf-shell .lf-copyrow .lf-btn{flex:1 1 100%}
}

@media (prefers-reduced-motion:reduce){
  .lf-shell *,
  .lf-sep-preview{transition:none!important;animation:none!important;scroll-behavior:auto!important}
}
