/* The shared frame: a top bar on every tool page, a slide-in menu that lists
   every tool, and a dismissible "runs in your browser" line. */

.shell-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
  padding: 0 clamp(12px, 3vw, 22px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(1.4) blur(4px);
}

.shell-left { display: flex; align-items: center; gap: 12px; min-width: 0; }

.shell-tools {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 600;
  font-size: .9rem;
}
.shell-tools:hover { background: var(--bg); }
.shell-tools svg { width: 15px; height: 15px; }

.shell-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -.01em;
}
.shell-brand svg { width: 22px; height: 22px; color: var(--accent); }

.shell-current {
  color: var(--text-2);
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shell-current::before { content: "/"; margin-right: 10px; color: var(--line-2); }

.shell-right { display: flex; align-items: center; gap: 14px; }

.shell-help {
  color: var(--text-2);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
}
.shell-help:hover { color: var(--accent); text-decoration: underline; }

.shell-local {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  text-decoration: none;
  font-size: .8rem;
  white-space: nowrap;
}
.shell-local svg { width: 15px; height: 15px; }
.shell-local:hover { color: var(--text); }

/* "More tools" strip at the foot of every tool page */
.shell-related {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px clamp(12px, 3vw, 28px) 56px;
  border-top: 1px solid var(--line);
}
.shell-related > h2 {
  margin: 0 0 12px;
  font-size: .7rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-2);
}
.shell-related-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.shell-related-grid a {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-in);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.shell-related-grid a:hover { border-color: var(--line-2); background: var(--bg); }
.shell-related-grid strong { display: block; font-size: .9rem; }
.shell-related-grid span { display: block; margin-top: 3px; font-size: .78rem; color: var(--text-2); line-height: 1.4; }
.shell-related-all { margin: 14px 0 0; font-size: .82rem; }
.shell-related-all a { color: var(--accent); text-decoration: none; }
.shell-related-all a:hover { text-decoration: underline; }

/* Notice under the bar */
.shell-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 7px 14px;
  background: var(--accent-bg);
  color: var(--accent-2);
  font-size: .82rem;
}
.shell-notice button { color: var(--accent-2); }

/* Menu */
.shell-scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 20, 28, .4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s;
}
.shell-scrim.open { opacity: 1; pointer-events: auto; }

.shell-menu {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 51;
  display: flex;
  flex-direction: column;
  width: min(360px, 88vw);
  height: 100%;
  background: var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transform: translateX(-100%);
  transition: transform .16s ease-out;
}
.shell-menu.open { transform: translateX(0); }

.shell-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.shell-menu-head strong { font-size: 1rem; }
.shell-menu-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.shell-menu-close:hover { background: var(--bg); }
.shell-menu-close svg { width: 16px; height: 16px; }

.shell-menu-body { overflow-y: auto; padding: 8px 8px 20px; }

.shell-menu-group { margin-top: 12px; }
.shell-menu-group:first-child { margin-top: 4px; }
.shell-menu-group > h3 {
  margin: 0;
  padding: 6px 10px;
  font-size: .7rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-2);
}

.shell-menu-item {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}
.shell-menu-item:hover { background: var(--bg); }
.shell-menu-item.current { background: var(--accent-bg); }
.shell-menu-item strong { display: block; font-size: .92rem; }
.shell-menu-item span { display: block; margin-top: 2px; font-size: .78rem; color: var(--text-2); line-height: 1.35; }
.shell-menu-item .tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  vertical-align: 1px;
}

/* Site-wide footer, appended by shell.js on every tool page */
.shell-foot {
  max-width: var(--maxw);
  margin: 40px auto 0;
  padding: 20px clamp(12px, 3vw, 28px) 40px;
  border-top: 1px solid var(--line);
  font-size: .82rem;
  color: var(--text-2);
}
.shell-foot p { margin: 0 0 4px; }
.shell-foot a { color: var(--text-2); }

/* A content wrapper tools may use */
.shell-frame {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 32px) clamp(12px, 3vw, 28px) 64px;
}

@media (max-width: 560px) {
  .shell-current { display: none; }
  .shell-local span { display: none; }
  .shell-right { gap: 10px; }
  .shell-menu { width: 100vw; border-right: 0; }
}

/* SEO "About" section, rendered into tool pages by scripts/gen-seo.mjs.
   Sits between the app and the shell.js footers. */
.tool-about {
  max-width: 72ch;
  margin: 44px auto 0;
  padding: 28px clamp(12px, 3vw, 28px) 8px;
  border-top: 1px solid var(--line);
}
.tool-about .crumbs {
  font-size: .78rem;
  color: var(--text-2);
  margin-bottom: 18px;
}
.tool-about .crumbs a { color: var(--text-2); text-decoration: none; }
.tool-about .crumbs a:hover { text-decoration: underline; }
.tool-about .crumbs span { margin: 0 6px; }
.tool-about h2 { font-size: 1.25rem; margin: 0 0 12px; letter-spacing: -.01em; }
.tool-about h3 { font-size: .96rem; margin: 24px 0 8px; }
.tool-about p { font-size: .92rem; line-height: 1.6; color: var(--text-2); margin: 0 0 12px; }
.tool-about .tool-steps { margin: 0; padding-left: 20px; }
.tool-about .tool-steps li { font-size: .92rem; line-height: 1.55; color: var(--text-2); margin-bottom: 6px; }
.tool-about .tool-faq { margin-top: 4px; }
.tool-about .tool-faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius-in);
  background: var(--surface);
  padding: 10px 14px;
  margin-bottom: 8px;
}
.tool-about .tool-faq summary {
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
}
.tool-about .tool-faq details[open] summary { margin-bottom: 6px; }
.tool-about .tool-faq p { margin: 0; font-size: .88rem; }
