:root {
  --bg: #f4f1ea;
  --bg-grid: rgba(17, 17, 17, 0.05);
  --surface: #ffffff;
  --surface-alt: #faf8f3;
  --ink: #111111;
  --muted: #4b4b4b;
  --subtle: #6b7280;

  --yellow: #ffe600;
  --coral: #ff5a36;
  --mint: #00e599;
  --cyan: #38bdf8;
  --violet: #a78bfa;
  --pink: #ff70a6;

  --code-bg: #14161b;
  --code-gutter: #1c1f26;
  --code-fg: #f3f4f6;
  --code-muted: #7c8596;
  --code-border: #2a2e38;

  --border-w: 3px;
  --border: 3px solid var(--ink);
  --border-thin: 2px solid var(--ink);
  --shadow: 4px 4px 0 var(--ink);
  --shadow-lg: 6px 6px 0 var(--ink);
  --shadow-sm: 2px 2px 0 var(--ink);
  --radius: 2px;

  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "SF Mono", "Cascadia Code", Menlo, Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    linear-gradient(to right, var(--bg-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--bg-grid) 1px, transparent 1px);
  background-size: 28px 28px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

code,
pre,
.mono {
  font-family: var(--font-mono);
}

/* Focus visibility */
:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ================= TOP NAVIGATION ================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 10px 0;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  padding: 6px 12px;
  background: var(--yellow);
  border: var(--border-thin);
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.brand-link:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

.brand-link:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--ink);
  color: var(--yellow);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.9rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.nav-badge-local {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 10px;
  background: var(--mint);
  border: var(--border-thin);
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 14px;
  background: var(--surface);
  border: var(--border-thin);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
  font-size: 0.92rem;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.1s ease;
}

.nav-btn:hover {
  background: var(--yellow);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

.nav-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}

.nav-btn.is-active {
  background: var(--ink);
  color: var(--yellow);
}

/* Tool switcher popover */
.tool-switcher {
  position: relative;
}

.switcher-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  max-width: calc(100vw - 24px);
  background: var(--surface);
  border: var(--border);
  box-shadow: var(--shadow-lg);
  padding: 12px;
  z-index: 200;
}

.switcher-popover[hidden] {
  display: none;
}

.switcher-group-title {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  padding: 6px 8px 4px;
  margin-top: 4px;
  border-bottom: 2px solid #e5e7eb;
}

.switcher-group-title:first-child {
  margin-top: 0;
}

.switcher-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  margin-top: 4px;
  border: 2px solid transparent;
  font-weight: 700;
  font-size: 0.9rem;
}

.switcher-item:hover {
  background: var(--yellow);
  border-color: var(--ink);
}

.switcher-item.is-current {
  background: var(--ink);
  color: var(--yellow);
  border-color: var(--ink);
}

.switcher-item-route {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  opacity: 0.75;
}

/* ================= MAIN SHELL ================= */
#app-main {
  flex: 1;
  padding: 24px 0 48px;
}

.page-enter {
  animation: nb-enter 0.16s ease-out;
}

@keyframes nb-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================= BUTTONS & CONTROLS ================= */
.nb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 16px;
  background: var(--surface);
  color: var(--ink);
  border: var(--border-thin);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.1s ease;
}

.nb-btn:hover:not(:disabled) {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

.nb-btn:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}

.nb-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.nb-btn-primary {
  background: var(--yellow);
}

.nb-btn-mint {
  background: var(--mint);
}

.nb-btn-coral {
  background: var(--coral);
  color: #ffffff;
}

.nb-btn-ink {
  background: var(--ink);
  color: var(--yellow);
}

.nb-btn-sm {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 0.82rem;
}

.nb-input,
.nb-select,
.nb-textarea {
  width: 100%;
  background: var(--surface);
  border: var(--border-thin);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 0.95rem;
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

.nb-input:focus,
.nb-select:focus,
.nb-textarea:focus {
  outline: none;
  background: #fffef2;
  box-shadow: 4px 4px 0 var(--ink);
}

.nb-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border: var(--border-thin);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 800;
  background: var(--surface);
}

.tag-format { background: var(--yellow); }
.tag-code { background: var(--coral); color: #fff; }
.tag-config { background: var(--violet); color: #111; }
.tag-encode { background: var(--cyan); }

.kbd-hint {
  display: inline-block;
  padding: 1px 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--surface-alt);
  border: 1.5px solid var(--ink);
  box-shadow: 1px 1px 0 var(--ink);
}

/* Segmented tabs */
.seg-group {
  display: inline-flex;
  flex-wrap: wrap;
  border: var(--border-thin);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
}

.seg-btn {
  min-height: 38px;
  padding: 6px 14px;
  background: transparent;
  border: none;
  border-right: var(--border-thin);
  font-weight: 800;
  font-size: 0.9rem;
}

.seg-btn:last-child {
  border-right: none;
}

.seg-btn:hover {
  background: #fff8cc;
}

.seg-btn.is-active {
  background: var(--ink);
  color: var(--yellow);
}

/* ================= HOME PAGE ================= */
.hero-workbench {
  background: var(--surface);
  border: var(--border);
  box-shadow: var(--shadow-lg);
  padding: 28px;
  margin-bottom: 28px;
  position: relative;
}

.hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.hero-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero-title mark {
  background: var(--yellow);
  color: var(--ink);
  padding: 0 8px;
  border: var(--border-thin);
}

.hero-subtitle {
  margin: 10px 0 0;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--muted);
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-pill {
  padding: 5px 11px;
  border: var(--border-thin);
  font-weight: 800;
  font-size: 0.84rem;
  box-shadow: var(--shadow-sm);
}

.hero-pill.p1 { background: var(--mint); }
.hero-pill.p2 { background: var(--yellow); }
.hero-pill.p3 { background: var(--cyan); }
.hero-pill.p4 { background: var(--surface-alt); }

.search-bar-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.search-input-box {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-input-box input {
  width: 100%;
  min-height: 48px;
  padding: 10px 100px 10px 42px;
  font-size: 1rem;
  font-weight: 600;
  border: var(--border);
  background: var(--surface-alt);
  box-shadow: var(--shadow);
}

.search-input-box input:focus {
  outline: none;
  background: #ffffff;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 1rem;
  pointer-events: none;
}

.search-shortcut-tip {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 4px;
  align-items: center;
  pointer-events: none;
}

.search-count-badge {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.9rem;
  background: var(--ink);
  color: var(--yellow);
  border: var(--border);
}

/* Tool groups & grid */
.tool-group {
  margin-bottom: 28px;
}

.tool-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.tool-group-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
  padding: 4px 12px;
  border: var(--border-thin);
  box-shadow: var(--shadow-sm);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 20px;
  min-height: 186px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}

.tool-card:hover,
.tool-card:focus-visible {
  transform: translate(-3px, -3px);
  box-shadow: 7px 7px 0 var(--ink);
  background: #fffdf0;
}

.tool-card:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.tool-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.tool-icon-box {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: var(--border-thin);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.tool-card-title {
  margin: 0 0 6px;
  font-size: 1.18rem;
  font-weight: 900;
}

.tool-card-desc {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

.tool-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 2px dashed #d1d5db;
  font-weight: 800;
  font-size: 0.9rem;
}

.tool-enter-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: var(--yellow);
  border: 2px solid var(--ink);
}

.tool-card:hover .tool-enter-cta {
  background: var(--ink);
  color: var(--yellow);
}

.empty-search-box {
  background: var(--surface);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 28px;
  text-align: center;
  margin-bottom: 28px;
}

/* Quick try inline demo */
.quick-try-card {
  background: var(--surface);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 24px;
}

.quick-try-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.quick-try-body {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: stretch;
}

.quick-try-input {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  min-height: 92px;
  padding: 12px;
  background: var(--code-bg);
  color: var(--code-fg);
  border: var(--border-thin);
  resize: vertical;
}

.quick-try-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-width: 240px;
}

/* Privacy bar */
.privacy-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--mint);
  border: var(--border);
  box-shadow: var(--shadow);
  font-weight: 800;
  font-size: 0.94rem;
}

/* ================= TOOL PAGE SKELETON ================= */
.tool-page-header {
  background: var(--surface);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 18px 22px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tool-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}

.tool-breadcrumb a:hover {
  text-decoration: underline;
}

.tool-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.tool-page-title {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.tool-page-desc {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 600;
}

.action-bar {
  background: var(--surface);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.workspace-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.workspace-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-card {
  background: var(--surface);
  border: var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface-alt);
  border-bottom: var(--border-thin);
}

.panel-title {
  font-weight: 900;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.panel-body {
  padding: 16px;
  flex: 1;
}

.panel-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  background: var(--surface-alt);
  border-top: var(--border-thin);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

/* ================= CODE EDITOR & VIEWER ================= */
.code-box-wrap {
  position: relative;
  display: flex;
  background: var(--code-bg);
  color: var(--code-fg);
  min-height: 380px;
  max-height: 620px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 22px;
}

.code-gutter {
  width: 52px;
  flex-shrink: 0;
  background: var(--code-gutter);
  border-right: 1px solid var(--code-border);
  color: var(--code-muted);
  padding: 12px 0 36px;
  text-align: right;
  user-select: none;
  overflow: hidden;
}

.code-gutter-line {
  padding: 0 10px 0 4px;
  height: 22px;
  line-height: 22px;
  font-size: 12px;
}

.code-gutter-line.is-error-line {
  background: rgba(255, 90, 54, 0.35);
  color: #ffe4e6;
  font-weight: 800;
}

.code-scroll-area {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: auto;
}

.code-highlight-layer {
  margin: 0;
  padding: 12px 16px;
  min-height: 100%;
  min-width: 100%;
  width: max-content;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 22px;
  tab-size: 2;
  white-space: pre;
  pointer-events: none;
}

.code-line-bg {
  display: block;
  min-height: 22px;
}

.code-line-bg.is-error-line {
  background: rgba(255, 90, 54, 0.25);
  box-shadow: inset 3px 0 0 var(--coral);
}

.code-textarea-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 12px 16px;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: transparent;
  caret-color: var(--yellow);
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 22px;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
}

.code-textarea-overlay::selection {
  background: rgba(255, 230, 0, 0.28);
}

.code-textarea-overlay::placeholder {
  color: #6b7280;
}

.code-viewer-pre {
  margin: 0;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 22px;
  tab-size: 2;
  white-space: pre;
  min-width: 100%;
  width: max-content;
}

/* Syntax highlight tokens */
.tok-key { color: #7dd3fc; }
.tok-str { color: #86efac; }
.tok-num { color: #fde047; }
.tok-bool { color: #f472b6; font-weight: 700; }
.tok-kw { color: #c4b5fd; font-weight: 700; }
.tok-com { color: #7c8596; font-style: italic; }
.tok-punc { color: #cbd5e1; }
.tok-var { color: #fda4af; }
.tok-doc { color: #ffe600; font-weight: 800; }

/* ================= STATUS & DIAGNOSTICS ================= */
.status-banner {
  padding: 12px 16px;
  border-bottom: var(--border-thin);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 800;
}

.status-banner.is-success {
  background: var(--mint);
}

.status-banner.is-error {
  background: var(--coral);
  color: #ffffff;
}

.status-banner.is-warn {
  background: var(--yellow);
}

.status-banner.is-info {
  background: var(--cyan);
}

.summary-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface-alt);
  border-bottom: var(--border-thin);
}

.stat-chip {
  padding: 5px 10px;
  background: var(--surface);
  border: var(--border-thin);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
}

.error-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.error-item {
  width: 100%;
  text-align: left;
  background: #fff5f3;
  border: var(--border-thin);
  box-shadow: var(--shadow-sm);
  padding: 12px 14px;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.error-item:hover {
  background: #ffe8e3;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

.error-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.error-loc-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 800;
  background: var(--coral);
  color: #fff;
  padding: 2px 8px;
  border: 1.5px solid var(--ink);
}

.error-msg {
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.error-hint {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.error-snippet {
  margin: 0;
  padding: 8px 10px;
  background: var(--code-bg);
  color: var(--code-fg);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  overflow-x: auto;
  border: 1.5px solid var(--ink);
}

.empty-state-box {
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
}

.empty-state-box h3 {
  margin: 0 0 8px;
  color: var(--ink);
}

/* ================= CRON / NGINX / TIMESTAMP / BASE64 ================= */
.cron-field-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 2px dashed #e5e7eb;
}

.cron-field-row:last-child {
  border-bottom: none;
}

.cron-field-label {
  font-weight: 900;
  font-size: 0.92rem;
  padding-top: 6px;
}

.cron-field-range {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted);
  font-weight: 600;
}

.cron-quick-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip-btn {
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--surface-alt);
  border: 1.5px solid var(--ink);
}

.chip-btn:hover {
  background: var(--yellow);
}

.chip-btn.is-active {
  background: var(--ink);
  color: var(--yellow);
}

.cron-expr-display {
  font-family: var(--font-mono);
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 16px;
  background: var(--code-bg);
  color: var(--yellow);
  border: var(--border-thin);
  text-align: center;
  word-break: break-all;
}

.cron-next-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cron-next-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface-alt);
  border: 2px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
}

/* Accordion details for Nginx */
.nb-accordion {
  border: var(--border-thin);
  background: var(--surface);
  margin-bottom: 14px;
}

.nb-accordion summary {
  padding: 12px 14px;
  font-weight: 900;
  cursor: pointer;
  background: var(--surface-alt);
  border-bottom: 2px solid transparent;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nb-accordion[open] summary {
  border-bottom: var(--border-thin);
  background: var(--yellow);
}

.nb-accordion-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field label {
  font-weight: 800;
  font-size: 0.88rem;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.form-error {
  font-size: 0.84rem;
  font-weight: 800;
  color: #b91c1c;
  background: #fee2e2;
  border: 1.5px solid var(--ink);
  padding: 4px 8px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--ink);
}

.live-clock-card {
  background: var(--ink);
  color: var(--surface);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.live-ts-value {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  font-weight: 900;
  color: var(--yellow);
}

.kv-result-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-alt);
  border: var(--border-thin);
  margin-bottom: 10px;
}

.kv-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--muted);
}

.kv-value {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.95rem;
  word-break: break-all;
}

/* ================= TOOL FOOTER & SITE FOOTER ================= */
.tool-bottom-section {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.recommend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.recommend-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: var(--border-thin);
  box-shadow: var(--shadow-sm);
  font-weight: 800;
}

.recommend-card:hover {
  background: var(--yellow);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

.site-footer {
  background: var(--ink);
  color: var(--surface);
  border-top: var(--border);
  padding: 28px 0;
  margin-top: auto;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 0.9rem;
  font-weight: 700;
}

.footer-links a:hover {
  color: var(--yellow);
  text-decoration: underline;
}

/* ================= HELP PAGE ================= */
.help-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.help-toc {
  position: sticky;
  top: 84px;
  background: var(--surface);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 16px;
}

.help-toc a {
  display: block;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 0.9rem;
  border-left: 3px solid transparent;
}

.help-toc a:hover {
  background: var(--yellow);
  border-left-color: var(--ink);
}

.help-section {
  background: var(--surface);
  border: var(--border);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 20px;
  scroll-margin-top: 86px;
}

.help-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.help-table th,
.help-table td {
  border: 2px solid var(--ink);
  padding: 10px 12px;
  text-align: left;
}

.help-table th {
  background: var(--yellow);
  font-weight: 900;
}

/* ================= TOAST ================= */
.toast-container {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  padding: 10px 16px;
  background: var(--ink);
  color: var(--yellow);
  border: 2px solid var(--ink);
  box-shadow: var(--shadow);
  font-weight: 800;
  font-size: 0.9rem;
  animation: nb-enter 0.14s ease-out;
}

.toast-item.is-success {
  background: var(--mint);
  color: var(--ink);
}

.toast-item.is-error {
  background: var(--coral);
  color: #ffffff;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 1024px) {
  .tools-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-split {
    grid-template-columns: 1fr;
  }

  .help-layout {
    grid-template-columns: 1fr;
  }

  .help-toc {
    position: static;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 14px;
  }

  .nav-badge-local {
    display: none;
  }

  .tools-grid {
    grid-template-columns: 1fr;
  }

  .quick-try-body {
    grid-template-columns: 1fr;
  }

  .cron-field-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .hero-workbench {
    padding: 18px;
  }

  .nb-btn,
  .nav-btn {
    min-height: 44px;
  }

  .nb-btn-sm {
    min-height: 36px;
  }

  .code-box-wrap {
    min-height: 280px;
    max-height: 440px;
  }
}
