/* ==========================================================================
   nullen.cc — shared tool page styles
   The app bar, the split layout, the editor, the actions, the result panel
   and the footer. Every tool page uses this file; each tool adds its own
   specifics next to it.
   ========================================================================== */

/* ---------- Layout ---------- */
.tool-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ---------- App bar ---------- */
.app-bar {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--code-bg);
  color: #ffffff;
  border-bottom: 1px solid var(--code-line);
}

/* the same reading-progress line the site header uses */
.app-bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(var(--scroll-progress, 0));
  transform-origin: left;
  transition: transform 0.12s linear;
}

.app-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  min-height: 68px;
}

.app-bar .logo {
  color: #ffffff;
  font-size: 18px;
}

.app-bar .logo em {
  color: var(--code-muted);
}

.app-bar__crumb {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.app-bar__crumb span {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent);
  background: rgba(111, 220, 99, 0.12);
  border: 1px solid rgba(111, 220, 99, 0.28);
  border-radius: var(--radius-pill);
  padding: 3px 12px;
  white-space: nowrap;
}

.app-bar__tools {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(111, 220, 99, 0.35);
  color: var(--accent);
  border-radius: var(--radius-pill);
  padding: 7px var(--space-4);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.privacy-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.app-bar .theme-toggle {
  color: var(--code-muted);
  border-color: var(--code-line);
}

.app-bar .theme-toggle:hover {
  color: #ffffff;
  border-color: var(--accent);
  background: rgba(111, 220, 99, 0.12);
}

/* ---------- Split layout ---------- */
.app-split {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

.app-pane {
  padding: var(--space-10) 0 var(--space-20);
}

.app-pane + .app-pane {
  border-left: 1px solid var(--line);
}

.app-pane__inner {
  padding-inline: var(--gutter);
  max-width: 680px;
}

.app-pane--left .app-pane__inner {
  margin-left: auto;
  margin-right: 0;
}

.app-pane--right .app-pane__inner {
  margin-right: auto;
  margin-left: 0;
}

/* ---------- Step titles ---------- */
.step-title {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-2xl);
  letter-spacing: -0.04em;
}

.step-title__num {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--accent-text);
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: var(--radius-pill);
  padding: 4px 11px;
}

.step-title + .step-block {
  margin-top: var(--space-6);
}

.step-title--spaced {
  margin-top: var(--space-12);
}

/* ---------- Editor ---------- */
.editor {
  border: 1px solid var(--code-line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--code-bg);
  transition: border-color var(--duration-fast) var(--ease),
    box-shadow var(--duration-fast) var(--ease);
}

.editor:focus-within {
  border-color: rgba(111, 220, 99, 0.55);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.editor__bar {
  display: flex;
  align-items: flex-end;
  gap: var(--space-4);
  padding: 8px var(--space-4) 0;
  background: var(--code-raised);
  border-bottom: 1px solid var(--code-line);
}

.editor__dots {
  display: flex;
  gap: 5px;
  padding-bottom: 9px;
}

.editor__dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

/* the file name reads as a tab */
.editor__file {
  padding: 7px 14px;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  background: var(--code-bg);
  border: 1px solid var(--code-line);
  border-bottom: 0;
  margin-bottom: -1px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--code-fg);
}

.editor__hint {
  margin-left: auto;
  padding-bottom: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--code-muted);
}

.editor__area {
  display: block;
  width: 100%;
  min-height: 440px;
  resize: vertical;
  background: transparent;
  color: var(--code-fg);
  border: 0;
  padding: var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.75;
  tab-size: 2;
}

.editor__area:focus {
  outline: none;
}

.editor__area::placeholder {
  color: var(--code-muted);
}

.editor.is-dragging .editor__area {
  background: rgba(111, 220, 99, 0.06);
}

.editor__drop {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: rgba(11, 12, 14, 0.86);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--text-base);
  pointer-events: none;
}

.editor.is-dragging .editor__drop {
  display: flex;
}

/* ---------- Editor footer ---------- */
.editor__foot {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-5);
}

.editor__extra {
  margin-left: auto;
  color: var(--muted);
  font-size: var(--text-sm);
}

.editor__extra summary {
  cursor: pointer;
  white-space: nowrap;
}

.editor__extra input {
  display: block;
  width: 240px;
  max-width: 100%;
  margin-top: var(--space-3);
  padding: 9px var(--space-3);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.editor__extra input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- Notices ---------- */
.notice {
  margin-top: var(--space-5);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  display: none;
}

.notice.is-visible {
  display: block;
}

.notice--error {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-fg);
}

.notice--info {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
}

/* ---------- Actions ---------- */
.actions {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: var(--space-6);
  flex-wrap: wrap;
}

.action-btn {
  padding: 9px var(--space-5);
  border-radius: var(--radius-xs);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background-color var(--duration-fast) var(--ease),
    color var(--duration-fast) var(--ease);
}

.action-btn:hover {
  color: var(--ink);
}

.action-btn.is-active {
  background: var(--ink);
  color: var(--bg);
}

/* a group of checkboxes for the "pick your fixes" style tools */
.checks {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.checks label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease),
    background-color var(--duration-fast) var(--ease);
}

.checks label:hover {
  border-color: var(--line-strong);
}

.checks input {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
  margin: 0;
}

.checks label.is-off {
  opacity: 0.55;
}

/* ---------- Options row (selects, toggles) ---------- */
.options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.options label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--muted);
  font-size: var(--text-sm);
}

.options select {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  padding: 9px var(--space-3);
  color: var(--ink);
  font-size: var(--text-sm);
}

.options select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- Result panel ---------- */
.result {
  margin-top: var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: none;
  background: var(--surface);
}

.result.is-visible {
  display: block;
}

.result__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.result__head strong {
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.result__meta {
  color: var(--muted);
  text-align: right;
}

.result__body {
  max-height: 260px;
  overflow: auto;
  background: var(--code-bg);
}

.result__body pre {
  margin: 0;
  padding: var(--space-5);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.7;
  color: var(--code-fg);
  white-space: pre;
}

/* ---------- App footer ---------- */
.app-foot {
  position: sticky;
  bottom: 0;
  background: var(--code-bg);
  border-top: 1px solid var(--code-line);
}

.app-foot__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  flex-wrap: wrap;
  min-height: 72px;
}

.app-foot__note {
  color: var(--code-muted);
  font-size: var(--text-sm);
}

.app-foot__actions {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.app-foot__actions a {
  color: var(--code-muted);
  font-size: var(--text-sm);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.app-foot__actions a:hover {
  color: #ffffff;
}

/* ---------- Switch to another tool ---------- */
.tool-switch {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
}

.tool-switch__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.tool-switch__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.tool-switch__links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: var(--text-sm);
  transition: border-color var(--duration-fast) var(--ease),
    color var(--duration-fast) var(--ease),
    background-color var(--duration-fast) var(--ease);
}

.tool-switch__links a::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}

.tool-switch__links a:hover {
  border-color: var(--accent);
  color: var(--ink);
  background: var(--accent-soft);
}

.tool-switch__links a[aria-current="page"] {
  border-color: var(--accent);
  color: var(--ink);
  background: var(--accent-soft);
}

.tool-switch__links a[aria-current="page"]::before {
  opacity: 1;
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .app-split {
    grid-template-columns: 1fr;
  }

  .app-pane + .app-pane {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .app-pane--left .app-pane__inner,
  .app-pane--right .app-pane__inner {
    margin-inline: auto;
  }

  .editor__area {
    min-height: 280px;
  }
}

@media (max-width: 560px) {
  .app-foot__inner {
    padding-block: var(--space-4);
  }

  .app-bar__inner {
    flex-wrap: wrap;
    gap: var(--space-3);
    padding-block: var(--space-3);
  }

  .privacy-pill {
    font-size: 11px;
    padding: 5px var(--space-3);
  }

  .actions {
    width: 100%;
  }

  .action-btn {
    flex: 1 1 auto;
  }
}
