:root {
  --bg: #0f1216;
  --surface: #171b21;
  --surface-2: #1e242c;
  --border: #2a313b;
  --text: #e6e9ee;
  --text-dim: #9aa4b2;
  --accent: #4f9dde;
  --accent-soft: #2b4a66;
  --ok: #4fbf7b;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,.35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 880px; margin: 0 auto; padding: 0 20px; }

header.site {
  border-bottom: 1px solid var(--border);
  background: rgba(15,18,22,.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
header.site .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}
.logo:hover { text-decoration: none; }
.logo svg { display: block; }

nav.main a {
  color: var(--text-dim);
  margin-left: 18px;
  font-size: 15px;
}
nav.main a:hover, nav.main a.active { color: var(--text); text-decoration: none; }

.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 24px; cursor: pointer; }

main { padding: 36px 0 60px; }

h1 { font-size: 30px; margin: 0 0 8px; letter-spacing: -.3px; }
h2 { font-size: 21px; margin: 32px 0 12px; }
.lead { color: var(--text-dim); font-size: 17px; margin: 0 0 28px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent-soft); text-decoration: none; transform: translateY(-2px); }
.card .ico { font-size: 26px; margin-bottom: 10px; }
.card h3 { margin: 0 0 6px; font-size: 17px; color: var(--text); }
.card p { margin: 0; color: var(--text-dim); font-size: 14px; }

.tool {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
}

label { display: block; font-size: 14px; color: var(--text-dim); margin: 14px 0 6px; }

input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 11px 13px;
  font-size: 15px;
  font-family: var(--font);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 120px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 120px; }

button, .btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: filter .15s;
}
button:hover, .btn:hover { filter: brightness(1.1); text-decoration: none; }
button.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }

.result {
  margin-top: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  font-size: 20px;
  font-weight: 600;
  min-height: 24px;
  word-break: break-word;
}
.result.small { font-size: 15px; font-weight: 400; font-family: ui-monospace, "SF Mono", Menlo, monospace; white-space: pre-wrap; }
.muted { color: var(--text-dim); font-size: 14px; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.tabs button { background: var(--surface-2); color: var(--text-dim); border: 1px solid var(--border); padding: 7px 14px; font-weight: 500; font-size: 14px; }
.tabs button.active { background: var(--accent-soft); color: var(--text); border-color: var(--accent); }

.big-timer { font-size: 56px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; margin: 10px 0; }

footer.site {
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 14px;
  padding: 28px 0;
}
footer.site .inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
footer.site a { color: var(--text-dim); margin-right: 16px; }

@media (max-width: 640px) {
  nav.main { display: none; }
  nav.main.open { display: flex; flex-direction: column; position: absolute; top: 60px; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 0 0 0 12px; padding: 12px 20px; }
  nav.main.open a { margin: 6px 0; }
  .nav-toggle { display: block; }
  h1 { font-size: 25px; }
}
