:root {
  --ink: #12161C;
  --ink-raised: #171C24;
  --ink-input: #0D1015;
  --text: #EDEFF2;
  --text-dim: #8A94A3;
  --border: #262C36;
  --amber: #E8A33D;
  --amber-dim: #6B4E20;
  --teal: #3FA796;
  --red: #D9634B;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.mono { font-family: 'IBM Plex Mono', monospace; }
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark {
  width: 10px; height: 10px;
  background: var(--amber);
  border-radius: 2px;
  display: inline-block;
  transform: rotate(45deg);
}
.brand-name { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
.brand-tag { color: var(--text-dim); font-size: 13px; }
.layout { display: flex; flex: 1; min-height: 0; }
nav {
  width: 220px;
  border-right: 1px solid var(--border);
  padding: 16px 0;
  flex-shrink: 0;
  overflow-y: auto;
}
.nav-group-label { font-size: 11px; color: var(--text-dim); padding: 8px 20px 6px; text-transform: none; }
.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  padding: 9px 20px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  text-decoration: none;
}
.nav-item:hover { color: var(--text); background: var(--ink-raised); }
.nav-item.active { color: var(--text); border-left-color: var(--amber); background: var(--ink-raised); }
main { flex: 1; padding: 32px 40px; overflow-y: auto; min-width: 0; }
.tool-title { font-size: 22px; font-weight: 600; margin: 0 0 4px; }
.tool-desc { color: var(--text-dim); font-size: 14px; margin: 0 0 24px; }
.panel { display: flex; flex-direction: column; gap: 4px; margin-bottom: 20px; }
.panel-label { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-dim); }
.panel-label .status { font-size: 12px; }
.status.valid { color: var(--teal); }
.status.invalid { color: var(--red); }
textarea, input[type="text"] {
  width: 100%; background: var(--ink-input); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); padding: 12px 14px; font-family: 'IBM Plex Mono', monospace;
  font-size: 13.5px; line-height: 1.6; resize: vertical; outline: none;
}
textarea:focus, input[type="text"]:focus { border-color: var(--amber-dim); }
textarea { min-height: 130px; }
.output-box {
  background: var(--ink-input); border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px;
  font-family: 'IBM Plex Mono', monospace; font-size: 13.5px; line-height: 1.6; white-space: pre-wrap;
  word-break: break-all; min-height: 60px; max-height: 400px; overflow-y: auto;
}
.output-box.error { color: var(--red); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
button {
  font-family: 'Space Grotesk', sans-serif; font-weight: 500; font-size: 13.5px; padding: 9px 16px;
  border-radius: 6px; border: 1px solid var(--border); background: var(--ink-raised); color: var(--text);
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
button:hover { border-color: var(--amber-dim); }
button.primary { background: var(--amber); color: #1A1204; border-color: var(--amber); font-weight: 600; }
button.primary:hover { background: #F0AE4E; }
.copy-btn { font-size: 12.5px; padding: 6px 12px; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.field-grid label { font-size: 12px; color: var(--text-dim); display: block; margin-bottom: 5px; }
.jwt-part { padding: 2px 0; }
.jwt-part.header { color: #F0729A; }
.jwt-part.payload { color: var(--teal); }
.jwt-part.signature { color: var(--text-dim); }
.divider { color: var(--border); }
.hash-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.hash-row:last-child { border-bottom: none; }
.hash-algo { color: var(--text-dim); font-size: 12.5px; }
.hash-val { font-family: 'IBM Plex Mono', monospace; font-size: 13px; word-break: break-all; }
footer { padding: 14px 28px; border-top: 1px solid var(--border); color: var(--text-dim); font-size: 12px; flex-shrink: 0; }
.home-intro { max-width: 680px; }
.tool-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; max-width: 760px; }
.tool-link { color: var(--text); text-decoration: none; border: 1px solid var(--border); background: var(--ink-raised); border-radius: 6px; padding: 14px; }
.tool-link:hover { border-color: var(--amber-dim); }
.tool-link strong { display: block; margin-bottom: 4px; }
.tool-link span { color: var(--text-dim); font-size: 12px; }
@media (max-width: 720px) {
  .layout { flex-direction: column; }
  nav { width: 100%; border-right: none; border-bottom: 1px solid var(--border); display: flex; overflow-x: auto; padding: 10px 0; white-space: nowrap; }
  .nav-group-label { display: none; }
  .nav-item { display: inline-block; width: auto; border-left: none; border-bottom: 2px solid transparent; }
  .nav-item.active { border-left: none; border-bottom-color: var(--amber); }
  main { padding: 24px 20px; }
}
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }