.ad-slot,.ad-leaderboard,.ad-in-article,.ad-anchor,.ad-placeholder,[class*='ad-slot']{display:none!important;width:0!important;height:0!important;margin:0!important;padding:0!important;}

.tool-hero {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  padding: 3rem 1.5rem 2.5rem; text-align: center; color: #fff;
}
.tool-hero h1 { font-size: 2rem; font-weight: 800; color: #fff !important; line-height: 1.25; margin: 0 auto 0.5rem; max-width: 720px; }
.tool-hero p { color: rgba(255,255,255,0.88); font-size: 1rem; max-width: 560px; margin: 0 auto; }
.tool-badge {
  display: inline-flex; align-items: center; gap: 0.4rem; background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3); border-radius: 50px; padding: 0.3rem 0.9rem; font-size: 0.8rem; color: #fff; margin-bottom: 1rem;
}

.tool-page { max-width: 1020px; margin: 0 auto; padding: 2.25rem 1.5rem; }
.calc-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 18px;
  padding: 1.45rem; box-shadow: var(--shadow); margin-bottom: 1.4rem;
}
.calc-card h2 { font-size: 1.04rem; font-weight: 700; color: var(--text); margin: 0 0 0.95rem; }

.preset-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.preset-title { font-size: 0.84rem; font-weight: 700; color: var(--text); margin-right: 0.25rem; }
.preset-pill {
  background: var(--bg); color: var(--text-muted); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.34rem 0.85rem; font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.preset-pill.is-active { background: #6366f1; border-color: #6366f1; color: #fff; }

.workspace-grid { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 1.4rem; align-items: start; }
@media (max-width: 840px) { .workspace-grid { grid-template-columns: 1fr; } }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }

.form-field { margin-bottom: 0.9rem; }
.form-field label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text); margin-bottom: 0.32rem; }
.form-field input[type="text"], .form-field input[type="number"], .form-field select {
  width: 100%; background: var(--bg); color: var(--text); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 0.52rem 0.75rem; font-size: 0.86rem; outline: none; box-sizing: border-box;
}
.form-field input[type="range"] { width: 100%; accent-color: #6366f1; }

.sep { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.item-head h2 { margin: 0; font-size: 0.96rem; }
.item-btns { display: flex; gap: 0.4rem; }
.mini-btn {
  background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 8px;
  padding: 0.3rem 0.65rem; font-size: 0.78rem; font-weight: 700; cursor: pointer;
}
.mini-btn:hover { border-color: #6366f1; color: #6366f1; }

.preview-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.9rem; }
.preview-head h2 { margin: 0; }
.hint-chip { font-size: 0.76rem; color: var(--text-muted); }

.flex-stage {
  min-height: 260px; border: 2px dashed rgba(99,102,241,0.35); border-radius: 14px;
  background: var(--bg); padding: 1rem; display: flex; box-sizing: border-box;
}
.flex-box-item {
  min-width: 64px; min-height: 54px; padding: 0.65rem 0.95rem; border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; font-weight: 700;
  font-size: 0.88rem; display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; border: 2px solid transparent; transition: transform 0.14s, border-color 0.14s;
}
.flex-box-item span { font-size: 0.68rem; font-weight: 500; opacity: 0.85; }
.flex-box-item.is-selected { border-color: #fbbf24; box-shadow: 0 0 0 3px rgba(251,191,36,0.35); transform: translateY(-2px); }

.output-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.65rem; margin-bottom: 0.85rem; }
.fmt-switch { display: inline-flex; background: var(--bg); border: 1px solid var(--border); border-radius: 9px; padding: 2px; }
.fmt-btn { border: none; background: transparent; padding: 0.35rem 0.78rem; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); border-radius: 7px; cursor: pointer; }
.fmt-btn.is-active { background: #6366f1; color: #fff; }

.copy-btn {
  background: #6366f1; color: #fff; border: none; border-radius: 9px; padding: 0.45rem 0.95rem;
  font-size: 0.82rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem;
}

.code-box {
  background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 1.1rem 1.2rem;
  overflow-x: auto; margin: 0; font-family: ui-monospace, Menlo, monospace; font-size: 0.83rem; line-height: 1.6;
}
