/* Shared suite shell — tabbed tool desks (Format, JWT, Encode, Color, Lorem, …) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root, html[data-theme="light"] {
  --bg: #f7f8fb; --surface: #ffffff; --border: #d2d9e6; --accent: #4f46e5;
  --text: #1a2333; --muted: #5a6a83; --radius: 10px;
  --shell-bg: rgba(255, 255, 255, 0.94);
  --tab-on-fg: #fff;
}
html[data-theme="dark"] {
  --bg: #0d0f17; --surface: #161925; --border: #2a2f45; --accent: #6c63ff;
  --text: #e8eaf6; --muted: #9ca3af;
  --shell-bg: rgba(22, 25, 37, 0.94);
  --tab-on-fg: #fff;
}

html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.45; display: flex; flex-direction: column;
  min-height: 100dvh;
}
a { color: var(--accent); }

.suite-shell {
  flex: 0 0 auto;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: var(--shell-bg);
  backdrop-filter: blur(8px);
  padding: 0.35rem 0.75rem 0.4rem;
}
.suite-shell-inner { max-width: 1100px; margin: 0 auto; }
.suite-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.65rem;
}
.suite-back {
  font-size: 0.78rem; color: var(--muted); text-decoration: none;
  min-height: 28px; display: inline-flex; align-items: center;
}
.suite-back:hover { color: var(--text); }
.suite-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.suite-title {
  font-size: 1rem; font-weight: 700; line-height: 1.2;
  margin: 0; flex: 0 1 auto;
}
.suite-trust { font-size: 0.7rem; color: var(--muted); }
.suite-about {
  margin: 0; font-size: 0.72rem; color: var(--muted);
  margin-left: auto;
}
.suite-about summary {
  cursor: pointer; color: var(--muted); list-style: none;
  display: inline-flex; align-items: center; gap: 0.2rem;
  min-height: 28px; user-select: none;
}
.suite-about summary::-webkit-details-marker { display: none; }
.suite-about summary::before { content: "▸"; font-size: 0.65rem; }
.suite-about[open] summary::before { content: "▾"; }
.suite-about summary:hover { color: var(--text); }
.suite-about summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.suite-about-body {
  margin: 0.2rem 0 0.1rem; max-width: 40rem; line-height: 1.4;
  color: var(--muted); font-size: 0.74rem;
  width: 100%; flex-basis: 100%;
}
.suite-about[open] { display: contents; }
.suite-about[open] summary { margin-left: auto; }

.suite-tabs {
  display: flex; flex-wrap: nowrap; gap: 0.28rem;
  margin-top: 0.3rem;
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 0.05rem;
}
.suite-tab {
  flex: 0 0 auto;
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  padding: 0.28rem 0.6rem; border-radius: 7px; cursor: pointer; font-weight: 600;
  font-size: 0.78rem; min-height: 36px; white-space: nowrap;
}
.suite-tab:hover { color: var(--text); border-color: var(--muted); }
.suite-tab:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.suite-tab[aria-selected="true"] {
  background: var(--accent); border-color: var(--accent); color: var(--tab-on-fg);
}

.suite-grow { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.suite-panel { flex: 1; display: none; flex-direction: column; min-height: 0; }
.suite-panel[data-active="true"] { display: flex; }
.suite-frame {
  flex: 1 1 auto; width: 100%; border: 0;
  background: var(--bg); display: block;
  min-height: 0; height: 100%;
}

.suite-more {
  flex: 0 0 auto; font-size: 0.75rem; color: var(--muted); text-align: center;
  padding: 0.45rem 0.75rem 0.7rem; line-height: 1.55;
  border-top: 1px solid var(--border);
}
.suite-more a { margin: 0 0.25rem; white-space: nowrap; }

@media (max-width: 768px) {
  .suite-shell {
    top: 0;
    padding-top: max(0.35rem, env(safe-area-inset-top, 0px));
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  }
  .suite-about[open] {
    display: block;
    width: 100%;
    flex-basis: 100%;
    margin-left: 0;
  }
  .suite-about[open] summary {
    margin-left: 0;
  }
  .suite-about summary {
    min-height: 44px;
    touch-action: manipulation;
  }
  .tool-hub-back,
  .tool-hub-back a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    touch-action: manipulation;
  }
  .suite-back {
    min-height: 44px;
    padding: 6px 4px;
    font-size: 0.82rem;
    touch-action: manipulation;
  }
  .suite-title { font-size: 0.95rem; }
  .suite-tabs {
    margin-top: 0.4rem;
    scroll-padding-inline: 8px;
    touch-action: pan-x;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 10px, #000 calc(100% - 10px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 10px, #000 calc(100% - 10px), transparent 100%);
  }
  .suite-tab {
    min-height: 44px;
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    touch-action: manipulation;
  }
  .suite-tab:active {
    color: var(--text);
    border-color: var(--muted);
  }
  .suite-more {
    padding-bottom: max(0.7rem, env(safe-area-inset-bottom, 0px));
    font-size: 0.78rem;
  }
  .suite-more a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 4px 6px;
  }
}

@media (max-width: 420px) {
  .suite-trust { white-space: normal; }
  .suite-about { margin-left: 0; }
  .suite-bar { gap: 0.35rem 0.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .suite-shell { backdrop-filter: none; }
}
