/* Shared ABC Tools shell — SweFlops-style tab layout */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #0d1117;
  --bg2: #151b24;
  --bg3: #1a222e;
  --line: #2a3444;
  --text: #e8eef6;
  --muted: #8b9bb0;
  --accent: #d4a017;
  --accent-dim: #a67c00;
  --ok: #3db88a;
  --danger: #d35f5f;
  --radius: 6px;
  --frame-min: 70vh;
  /* Fallback only — tool pages set their own --layout-width before this file. */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  background: var(--bg);
}

body {
  background:
    radial-gradient(1200px 500px at 10% -10%, #1a2433 0%, transparent 55%),
    radial-gradient(900px 400px at 100% 0%, #1c1810 0%, transparent 50%),
    var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.app {
  max-width: var(--layout-width, 1100px);
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.app.wide { max-width: var(--layout-width, 1200px); }

.brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 16px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.brand h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand .ver {
  color: var(--muted);
  font-size: 0.85rem;
  font-family: "IBM Plex Mono", monospace;
}

.brand .meta-line {
  width: 100%;
  color: var(--muted);
  font-size: 0.9rem;
}

.brand-logo {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
}

.brand-logo img {
  display: block;
  width: 72px;
  height: auto;
  filter: invert(1);
}

.abc-site-shell {
  max-width: var(--layout-width, 1200px);
  width: 100%;
  margin: 0 auto;
  padding: 20px 18px 0;
  box-sizing: border-box;
}

body.has-abc-site-nav .abc-site-shell {
  margin-bottom: 4px;
}

/* Home: shell lives inside .app — don't double-constrain. */
.app > .abc-site-shell {
  max-width: none;
  width: auto;
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
}

/* Decoder tools: shell shares <header> with header-inner */
header > .abc-site-shell {
  max-width: var(--layout-width, 1200px);
  width: 100%;
  margin: 0 auto 16px;
  padding: 0;
  box-sizing: border-box;
}

/* Monitorn / Archive: shell in .site-top (same column as decoder header) */
.site-top {
  padding: 20px 18px 0;
}
.site-top > .abc-site-shell {
  max-width: var(--layout-width, 1200px);
  width: 100%;
  margin: 0 auto 16px;
  padding: 0;
  box-sizing: border-box;
}

.abc-site-shell .abc-site-brand.brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 16px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line, #2a3444);
  padding-bottom: 14px;
}

.abc-site-shell .brand h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text, #e8eef6);
}

.abc-site-shell .brand .ver {
  color: var(--muted, #8b9bb0);
  font-size: 0.85rem;
  font-family: "IBM Plex Mono", "Cascadia Code", Consolas, monospace;
}

.abc-site-shell .brand .meta-line {
  width: 100%;
  color: var(--muted, #8b9bb0);
  font-size: 0.9rem;
}

.abc-site-shell .brand-logo {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
}

.abc-site-shell .brand-logo img {
  display: block;
  width: 72px;
  height: auto;
  filter: invert(1);
}

.abc-site-nav.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--line, #2a3444);
  padding-bottom: 0;
}

.abc-site-nav .tab {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted, var(--subdued, #8b9bb0));
  font: inherit;
  font-weight: 500;
  padding: 10px 14px;
  margin-bottom: -1px;
  cursor: pointer;
  border-radius: 0;
  box-shadow: none;
  text-decoration: none;
  display: inline-block;
}

.abc-site-nav .tab:hover {
  color: var(--text, var(--ink, #e8eef6));
  text-decoration: none;
}

.abc-site-nav .tab.active {
  color: var(--accent, var(--amber, #d4a017));
  border-bottom-color: var(--accent, var(--amber, #d4a017));
}

/* Hide legacy back-links when shared chrome is present (never hide .abc-site-shell) */
body.has-abc-site-nav a.header-link[href*="index.php"],
body.has-abc-site-nav a.header-link[href*="index.html"],
body.has-abc-site-nav .hero a.btn[href*="index.php"],
body.has-abc-site-nav .hero a.btn[href*="index.html"] {
  display: none !important;
}

/* Site chrome stays visible even in legacy embed mode */
body.embed-mode .abc-site-shell {
  display: block !important;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
}

.tab,
a.tab {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 500;
  padding: 10px 14px;
  margin-bottom: -1px;
  cursor: pointer;
  border-radius: 0;
  box-shadow: none;
  text-decoration: none;
  display: inline-block;
}

.tab:hover,
a.tab:hover { color: var(--text); background: transparent; text-decoration: none; }

.tab.active,
a.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: transparent;
  box-shadow: none;
  transform: none;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.section {
  margin-bottom: 22px;
}

.section h2 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hint {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 10px 0 0;
}

.card-block {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
}

.card-block h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.card-block p {
  margin: 0 0 12px;
  color: var(--muted);
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
}

.btn:hover { border-color: var(--accent-dim); color: var(--accent); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1400;
}
.btn-primary:hover { background: #e0b12a; color: #1a1400; }

/* When a tool page is loaded inside the index iframe */
body.embed-mode > header,
body.embed-mode > footer {
  display: none !important;
}
body.embed-mode > main {
  padding-top: 12px;
}
