:root {
  --bg: #f6f7fb;
  --card: #fff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #4f46e5;
  --primary-2: #4338ca;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial; }

.wrap { max-width: 880px; margin: 0 auto; padding: 16px; }

.topbar { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.9); backdrop-filter: saturate(180%) blur(6px); border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0 0 8px; font-size: 22px; }
.tabs { display: flex; gap: 8px; }
.tab { border: 0; background: #e5e7eb; color: #111827; padding: 8px 14px; border-radius: 12px; cursor: pointer; }
.tab.active { background: var(--primary); color: #fff; }

.controls { margin: 12px 0 6px; }
.grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }

.field .label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.input { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); outline: none; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }

.note { font-size: 12px; color: var(--muted); margin-top: 6px; }

.col { display: grid; gap: 12px; margin-top: 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.card .hint { margin: 0 0 10px; font-size: 12px; color: var(--muted); }

.card .domain { margin: 8px 0 10px; }
.card .domain input { width: 100%; }

.output { background: #f9fafb; border: 1px solid var(--line); border-radius: 12px; padding: 10px; white-space: pre-wrap; font-size: 14px; }
.row-end { display: flex; justify-content: flex-end; margin-top: 10px; }

.btn { border: 0; background: var(--primary); color: #fff; padding: 8px 12px; border-radius: 12px; cursor: pointer; }
.btn:hover { background: var(--primary-2); }
.btn:active { transform: translateY(1px); }

.footer { color: var(--muted); font-size: 12px; padding: 20px 0 50px; }
.hidden { display: none; }
