:root {
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --primary-light: #e0f2fe;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.05);
  --code-bg: #0f172a;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 1.5rem; position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.site-header .inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 1rem; height: 58px; }
.site-logo { font-weight: 700; font-size: 1.15rem; color: var(--primary); white-space: nowrap; }
.site-nav { display: flex; gap: .5rem; flex-wrap: wrap; flex: 1; }
.site-nav a { font-size: .85rem; color: var(--text-muted); padding: .3rem .7rem; border-radius: 6px; transition: background .15s, color .15s; }
.site-nav a:hover, .site-nav a.active { background: var(--primary-light); color: var(--primary); text-decoration: none; }

.ad-banner { background: var(--surface); border-bottom: 1px solid var(--border); text-align: center; padding: .5rem; min-height: 90px; display: flex; align-items: center; justify-content: center; }
.ad-placeholder { background: #f1f5f9; border: 2px dashed #cbd5e1; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: .8rem; letter-spacing: .05em; }

.page-wrap { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; display: grid; grid-template-columns: 1fr 300px; gap: 2rem; flex: 1; }
@media (max-width: 820px) { .page-wrap { grid-template-columns: 1fr; padding: 1.25rem 1rem; } }

.tool-main h1 { font-size: 1.65rem; font-weight: 700; line-height: 1.25; margin-bottom: .4rem; }
.tool-tagline { color: var(--text-muted); font-size: .95rem; margin-bottom: 1.5rem; }
.tool-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.5rem; }

label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-muted); margin-bottom: .4rem; text-transform: uppercase; letter-spacing: .04em; }
textarea, input[type="text"], input[type="number"], select { width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: .65rem .9rem; font-size: .95rem; font-family: inherit; background: var(--bg); color: var(--text); transition: border-color .15s, box-shadow .15s; outline: none; }
textarea:focus, input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(14,165,233,.12); }
textarea { resize: vertical; min-height: 80px; font-family: "SF Mono","Fira Code",monospace; font-size: .9rem; }
.field { margin-bottom: 1.1rem; }

.btn { display: inline-flex; align-items: center; gap: .45rem; padding: .6rem 1.2rem; border-radius: 8px; font-size: .9rem; font-weight: 600; cursor: pointer; border: none; transition: transform .1s, box-shadow .15s, background .15s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(14,165,233,.3); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #f1f5f9; }
.btn-success { background: var(--success); color: #fff; }
.btn-group { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }

.output-box { background: var(--code-bg); color: #e2e8f0; border-radius: 8px; padding: 1rem; font-family: "SF Mono","Fira Code",monospace; font-size: .88rem; line-height: 1.6; overflow-x: auto; white-space: pre-wrap; word-break: break-all; min-height: 80px; position: relative; }
.output-box.empty { color: #475569; font-style: italic; }
.copy-btn { position: absolute; top: .5rem; right: .5rem; padding: .25rem .6rem; background: rgba(255,255,255,.1); color: #94a3b8; border: 1px solid rgba(255,255,255,.15); border-radius: 5px; font-size: .75rem; cursor: pointer; transition: background .15s; }
.copy-btn:hover { background: rgba(255,255,255,.2); color: #fff; }

.options-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.checkbox-label { display: flex; align-items: center; gap: .4rem; font-size: .9rem; font-weight: 500; cursor: pointer; text-transform: none; letter-spacing: 0; color: var(--text); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--primary); cursor: pointer; }

.alert { padding: .7rem 1rem; border-radius: 8px; font-size: .88rem; margin-top: .75rem; display: none; }
.alert.show { display: block; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge-blue { background: var(--primary-light); color: var(--primary); }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-yellow { background: #fef3c7; color: #92400e; }

.tool-sidebar { display: flex; flex-direction: column; gap: 1.25rem; }
.sidebar-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.sidebar-card h3 { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: .75rem 1rem; background: var(--bg); border-bottom: 1px solid var(--border); color: var(--text-muted); }
.related-links { list-style: none; }
.related-links li a { display: block; padding: .6rem 1rem; font-size: .88rem; border-bottom: 1px solid var(--border); color: var(--text); transition: background .12s; }
.related-links li:last-child a { border-bottom: none; }
.related-links li a:hover { background: var(--primary-light); text-decoration: none; }
.ad-sidebar { min-height: 250px; display: flex; align-items: center; justify-content: center; padding: .5rem; }

.content-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-top: 1.5rem; }
.content-section h2 { font-size: 1.2rem; margin-bottom: .75rem; }
.content-section h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.content-section p { font-size: .93rem; color: var(--text-muted); margin-bottom: .7rem; }
.content-section ul, .content-section ol { padding-left: 1.3rem; font-size: .93rem; color: var(--text-muted); }
.content-section li { margin-bottom: .3rem; }
.content-section code { background: #f1f5f9; padding: .1rem .35rem; border-radius: 4px; font-family: monospace; font-size: .88em; color: var(--primary-dark); }

.faq-item { border-bottom: 1px solid var(--border); padding: .85rem 0; }
.faq-item:last-child { border-bottom: none; }
.faq-q { font-weight: 600; font-size: .95rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.faq-q::after { content: "+"; font-size: 1.2rem; color: var(--primary); }
.faq-q.open::after { content: "−"; }
.faq-a { font-size: .88rem; color: var(--text-muted); margin-top: .5rem; display: none; }
.faq-a.show { display: block; }

.ad-incontent { margin: 1.5rem 0; min-height: 90px; display: flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }

.site-footer { margin-top: auto; background: var(--surface); border-top: 1px solid var(--border); padding: 1.5rem; text-align: center; font-size: .82rem; color: var(--text-muted); }
.site-footer .footer-links { display: flex; justify-content: center; gap: 1.2rem; margin-bottom: .5rem; flex-wrap: wrap; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--primary); }

#cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; background: #1e293b; color: #e2e8f0; padding: 1rem 1.5rem; display: none; align-items: center; gap: 1rem; z-index: 9999; flex-wrap: wrap; }
#cookie-banner p { flex: 1; font-size: .85rem; min-width: 200px; }
#cookie-banner a { color: #818cf8; }
.cookie-btns { display: flex; gap: .5rem; }
.cookie-btns button { padding: .4rem 1rem; border-radius: 6px; border: none; cursor: pointer; font-size: .83rem; font-weight: 600; }
#cookie-accept { background: var(--primary); color: #fff; }
#cookie-reject { background: transparent; border: 1px solid #475569 !important; color: #94a3b8; }

.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.text-sm { font-size: .85rem; color: var(--text-muted); }
.divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { background: var(--bg); padding: .5rem .75rem; text-align: left; font-weight: 600; border: 1px solid var(--border); }
td { padding: .5rem .75rem; border: 1px solid var(--border); font-family: monospace; }
tr:hover td { background: var(--primary-light); }
