/* ════════════════════════════════════════════════════════════════
   Session — 2005 social-network skin
   Lucida / Tahoma sans-serif. Soft Facebook-blue chrome.
   Two-column: white sidebar + white main card on a soft blue background.
   ════════════════════════════════════════════════════════════════ */

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

:root {
  --fb-blue:     #3b5998;   /* top-bar */
  --fb-blue-2:   #6d84b4;   /* page-title strip */
  --fb-blue-3:   #4f6aa1;   /* darker accent */
  --fb-page:     #d8dfea;   /* page background */
  --fb-card:     #ffffff;
  --fb-border:   #b0b0b0;
  --fb-divider:  #d8d8d8;
  --fb-rule:     #e8e8e8;
  --fb-text:     #1c1e21;
  --fb-text-2:   #333333;
  --fb-muted:    #6b7280;
  --fb-link:     #3b5998;
  --fb-link-hover:#1a4a8a;
  --fb-accent:   #7a1020;   /* kept for the imprint mark */
  --fb-hl:       #fffadd;
  --fb-ok:       #2e7d32;
  --fb-err:      #b71c1c;
  /* legacy aliases used by chat.html and other older inline styles */
  --paper:   #ffffff;
  --ink:     #14161c;
  --ink-2:   #2a2e3b;
  --accent:  #7a1020;
  --rule:    #c8c2b4;
  --rule-2:  #ece6d6;
  color-scheme: light;
}

html, body {
  margin: 0; padding: 0;
  background: var(--fb-page);
  color: var(--fb-text);
  font-family: "Lucida Grande", "Lucida Sans Unicode", "Tahoma", "Verdana", "Geneva", sans-serif;
  font-size: 11.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--fb-link); text-decoration: underline; }
a:visited { color: var(--fb-link); }
a:hover { color: var(--fb-link-hover); }
a:focus { outline: 1px dotted var(--fb-link); outline-offset: 2px; }

/* ── top blue bar ─────────────────────────────────────────────── */
.topbar {
  background: var(--fb-blue);
  color: #ffffff;
  height: 42px;
  border-bottom: 1px solid #2a3f6c;
  position: relative;
  z-index: 5;
}
.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 18px;
}
.topbar-brand {
  font-family: "Lucida Grande", "Tahoma", "Verdana", sans-serif;
  font-weight: 700;
  font-size: 24px;
  color: #ffffff !important;
  text-decoration: none !important;
  letter-spacing: -0.02em;
  line-height: 1;
}
.topbar-brand img { display: none; }
.topbar-brand:hover { color: #ffffff !important; text-decoration: none !important; opacity: 0.92; }
.topbar-nav {
  margin-left: auto;
  display: flex; gap: 14px;
  font-size: 11px;
}
.topbar-nav a {
  color: #ffffff;
  text-decoration: none;
  padding: 4px 6px;
}
.topbar-nav a:hover { text-decoration: underline; color: #ffffff; }
.topbar-nav .sep { color: #aab8d6; }
.topbar-nav #topbar-bell { position: relative; padding: 4px 8px; }
.topbar-nav .bell-count {
  display: inline-block;
  position: absolute;
  top: -2px; right: -2px;
  background: #d63a3a;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-family: "Tahoma", sans-serif;
  padding: 1px 5px;
  border-radius: 999px;
  line-height: 1;
  min-width: 14px;
  text-align: center;
}

/* ── outer frame: full-width by default; opt-in 200px sidebar ── */
.frame {
  max-width: 760px;
  margin: 12px auto 28px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 0 12px;
}
.frame:has(> .sidebar) {
  max-width: 960px;
  grid-template-columns: 200px 1fr;
}

.frame > .head { display: none; }       /* removed: redundant with topbar */
.frame > .head .wordmark {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0;
  text-transform: none;
  display: flex; align-items: center; gap: 8px;
}
.frame > .head .wordmark a { color: #ffffff; text-decoration: none; }
.frame > .head .wordmark .mark { display: none; } /* the topbar already shows the brand */
.frame > .head .wordmark small {
  font-size: 11px;
  font-weight: 400;
  color: #e3e8f3;
  letter-spacing: 0.03em;
  margin-left: 8px;
  text-transform: none;
}
.frame > .head .tagline {
  margin: 2px 0 0;
  font-style: normal;
  font-size: 11px;
  color: #e3e8f3;
}
.frame > .head .meta {
  margin-top: 4px;
  font-family: "Lucida Grande", Tahoma, sans-serif;
  font-size: 10.5px;
  color: #e3e8f3;
  letter-spacing: 0;
  text-transform: none;
}
.frame > .head .meta a { color: #ffffff; }

.frame > .body {
  grid-column: 1;
  background: var(--fb-card);
  border: 1px solid var(--fb-border);
  padding: 14px 18px 18px;
  font-size: 11.5px;
  border-radius: 2px;
  min-width: 0;          /* Prevent wide children (pre/code) from growing the grid item */
  overflow-wrap: break-word;
  word-wrap: break-word;
}
.frame > * { min-width: 0; }
.frame:has(> .sidebar) > .body { grid-column: 2; }

/* Force pre/code blocks to never push their parent wider than the card */
.body pre, .post-body pre, pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre;
}

.frame > .foot {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 10.5px;
  color: var(--fb-muted);
  padding: 14px 8px 4px;
  background: transparent;
  border: 0;
  font-family: "Lucida Grande", Tahoma, sans-serif;
}
.frame > .foot a { color: var(--fb-link); text-decoration: none; }
.frame > .foot a:hover { text-decoration: underline; }

/* ── sidebar ─────────────────────────────────────────────────── */
.sidebar {
  grid-column: 1;
  grid-row: 1 / span 2;
  background: var(--fb-card);
  border: 1px solid var(--fb-border);
  padding: 0;
  height: fit-content;
  font-size: 11px;
}
.sidebar .sb-section {
  border-bottom: 1px solid var(--fb-divider);
  padding: 8px 10px;
}
.sidebar .sb-section:last-child { border-bottom: 0; }
.sidebar h4 {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--fb-text);
}
.sidebar label {
  display: block;
  font-size: 11px;
  color: var(--fb-text-2);
  margin: 6px 0 2px;
}
.sidebar input[type="text"],
.sidebar input[type="email"],
.sidebar input[type="password"] {
  width: 100%;
  font-family: inherit;
  font-size: 11px;
  padding: 3px 5px;
  border: 1px solid #999;
  background: #fff;
  color: var(--fb-text);
}
.sidebar input:focus { outline: 1px solid var(--fb-blue); outline-offset: -1px; }
.sidebar .sb-actions { margin-top: 8px; display: flex; gap: 6px; }
.sidebar nav.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav.sb-nav a {
  display: block;
  padding: 4px 6px;
  color: var(--fb-link);
  text-decoration: none;
  font-size: 11px;
  border: 1px solid transparent;
  border-radius: 2px;
}
.sidebar nav.sb-nav a:hover {
  background: #eef2fa;
  border-color: #c0cdea;
  text-decoration: none;
}
.sidebar nav.sb-nav a.active {
  background: var(--fb-blue);
  color: #fff;
  border-color: var(--fb-blue);
  font-weight: 700;
}
.sidebar .small {
  font-size: 10.5px;
  color: var(--fb-muted);
}

/* ── buttons ─────────────────────────────────────────────────── */
.btn, button.btn, input.btn, .btn95 {
  font-family: inherit;
  font-size: 11px;
  background: linear-gradient(180deg, #e9ebf0 0%, #d8dbe4 100%);
  color: var(--fb-text);
  border: 1px solid #999;
  padding: 3px 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  border-radius: 2px;
  box-shadow: inset 0 1px 0 #ffffff;
  line-height: 1.6;
}
.btn:hover { background: linear-gradient(180deg, #f1f3f7 0%, #dfe2eb 100%); color: var(--fb-text); text-decoration: none; }
.btn:active { background: #c8ccd5; box-shadow: inset 0 1px 1px rgba(0,0,0,0.15); }
.btn.primary {
  background: linear-gradient(180deg, #5773b3 0%, #3b5998 100%);
  color: #ffffff;
  border-color: #2a3f6c;
  font-weight: 700;
  text-shadow: 0 -1px 0 rgba(0,0,0,0.2);
}
.btn.primary:hover { background: linear-gradient(180deg, #6280bd 0%, #4666a3 100%); color: #ffffff; }
.btn.primary:active { background: #2a3f6c; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ── typography in main content ──────────────────────────────── */
.body h1, .body h2, .body h3, .body h4 {
  font-family: "Lucida Grande", "Tahoma", sans-serif;
  color: var(--fb-text);
  margin: 14px 0 6px;
  line-height: 1.25;
}
.body h1 { font-size: 16px; }
.body h2 { font-size: 14px; font-weight: 700; padding: 0; border: 0; }
.body h2::before { content: none; }   /* drop the crimson accent bar from the prior theme */
.body h3 { font-size: 12.5px; font-weight: 700; }
.body h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fb-blue-3); }

p { margin: 6px 0 8px; }
.body p { font-size: 11.5px; line-height: 1.5; }

ul, ol { margin: 6px 0 10px; padding-left: 22px; }
.body ul li, .body ol li { margin: 2px 0; font-size: 11.5px; }
.body ul { list-style: none; padding-left: 16px; }
.body ul li::before { content: "•"; color: var(--fb-blue); margin-right: 6px; margin-left: -10px; font-weight: 700; }

hr.rule, hr.rule2 { border: 0; border-top: 1px solid var(--fb-rule); margin: 14px 0; }

/* drop cap (from old theme) — disabled to fit the FB look */
.dropcap::first-letter, .post-body > p:first-of-type::first-letter {
  font-size: inherit; font-weight: inherit; color: inherit;
  float: none; padding: 0; margin: 0;
}

/* code */
code, kbd, samp {
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 11px;
  background: #f3f3f3;
  padding: 1px 4px;
  border: 1px solid #e0e0e0;
  border-radius: 2px;
  color: var(--fb-text-2);
}
pre {
  background: #f3f3f3;
  border: 1px solid #d8d8d8;
  padding: 10px 12px;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 11px;
  line-height: 1.45;
  overflow-x: auto;
  white-space: pre;
  margin: 10px 0;
  border-radius: 2px;
}

/* ── breadcrumbs ─────────────────────────────────────────────── */
.crumbs {
  font-size: 10.5px;
  color: var(--fb-muted);
  margin: 0 0 10px;
  font-family: inherit;
  letter-spacing: 0;
  text-transform: none;
}

/* ── callout ─────────────────────────────────────────────────── */
.callout {
  border: 1px solid #d6c97a;
  background: #fffbe0;
  padding: 10px 14px;
  margin: 14px 0;
  border-radius: 2px;
}
.callout::before { content: none; }
.callout h4 { margin: 0 0 4px; color: var(--fb-text); font-size: 11px; }
.callout p { margin: 4px 0; font-size: 11.5px; }
.callout .actions { margin-top: 8px; }
.callout .actions a { margin-right: 12px; font-weight: 700; color: var(--fb-link); }

/* ── tables ──────────────────────────────────────────────────── */
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  margin: 8px 0 12px;
}
table.tbl th, table.tbl td {
  text-align: left;
  vertical-align: top;
  padding: 6px 10px 6px 0;
  border-bottom: 1px solid var(--fb-divider);
}
table.tbl th {
  font-weight: 700;
  border-bottom: 2px solid var(--fb-border);
  color: var(--fb-text);
  font-size: 11px;
}
table.tbl td.k { color: var(--fb-muted); width: 36%; }

/* index card lists */
.index-cards { margin: 6px 0 0; padding: 0; list-style: none; }
.index-cards li { margin: 0; padding: 10px 0; border-top: 1px solid var(--fb-divider); }
.index-cards li:first-child { border-top: 0; padding-top: 4px; }
.index-cards li::before { content: none; }
.index-cards li > a { font-size: 12.5px; font-weight: 700; }
.index-cards li .meta { font-size: 10.5px; color: var(--fb-muted); margin-top: 1px; font-family: inherit; letter-spacing: 0; text-transform: none; }
.index-cards li p { margin: 4px 0 0; font-size: 11.5px; color: var(--fb-text-2); }

/* ── nav.toc (table of contents) ────────────────────────────── */
nav.toc {
  border: 1px solid #d0d4dd;
  background: #f0f3f9;
  padding: 8px 12px;
  margin: 0 0 16px;
  border-radius: 2px;
}
nav.toc h4 { margin: 0 0 4px; font-size: 10.5px; letter-spacing: 0.08em; color: var(--fb-blue-3); text-transform: uppercase; }
nav.toc ol { margin: 0; padding-left: 20px; font-size: 11.5px; columns: 2; column-gap: 22px; }
nav.toc li { margin: 1px 0; break-inside: avoid; }
nav.toc li::before { content: none; }

/* ── post page ───────────────────────────────────────────────── */
.post-title { font-size: 18px; line-height: 1.25; margin: 4px 0 4px; font-weight: 700; }
.post-summary { color: var(--fb-muted); margin: 0 0 8px; font-size: 12px; font-style: italic; }
.post-body { font-size: 12px; line-height: 1.55; }
.post-body h2 { font-size: 14px; }
.post-body h3 { font-size: 12.5px; }
.post-nav { display: flex; gap: 8px; justify-content: space-between; margin: 14px 0 6px; }
.post-nav > a, .post-nav > span {
  display: block; flex: 1 1 0;
  border: 1px solid var(--fb-divider);
  background: #fafbfc;
  padding: 8px 10px;
  text-decoration: none;
  color: var(--fb-text);
  border-radius: 2px;
  font-size: 11.5px;
}
.post-nav > a:hover { border-color: var(--fb-blue); background: #eef2fa; color: var(--fb-link); }
.post-nav-next { text-align: right; }
.post-nav .dir { display: block; font-size: 10px; color: var(--fb-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.post-nav .t { font-weight: 700; }

/* lex */
dl.lex { margin: 6px 0 12px; }
dl.lex dt { font-weight: 700; margin-top: 8px; }
dl.lex dt a { color: var(--fb-text); text-decoration: none; }
dl.lex dt a:hover { color: var(--fb-link); }
dl.lex dd { margin: 2px 0 0 0; color: var(--fb-text); font-size: 11.5px; }
dl.lex dd .see { display: block; font-size: 10.5px; color: var(--fb-muted); margin-top: 2px; }

/* form-block */
.form-block { margin: 10px 0; }
.form-block label { display: block; font-weight: 700; font-size: 11px; margin: 8px 0 3px; }
.form-block input[type="text"],
.form-block input[type="email"],
.form-block input[type="password"] {
  width: 100%; font-family: inherit; font-size: 12px;
  padding: 4px 6px; border: 1px solid #999;
  background: #fff; color: var(--fb-text);
  border-radius: 2px;
}
.form-block input:focus { outline: 1px solid var(--fb-blue); outline-offset: -1px; }
.form-block .hint { font-size: 10.5px; color: var(--fb-muted); margin-top: 3px; }
.form-block .actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.notice { margin-top: 10px; font-size: 11.5px; border: 1px solid #aaa; padding: 7px 10px; background: #f3f3f3; display: none; border-radius: 2px; }
.notice.ok  { background: #e6f4e6; border-color: #66a366; color: #1d4a1d; }
.notice.err { background: #fbe6e6; border-color: #b07474; color: #7a1a1a; }

.signed-in { display: none; border: 1px solid #66a366; background: #eef7ee; padding: 10px 12px; margin-top: 10px; border-radius: 2px; }
.signed-in code { display: block; font-family: "Consolas", monospace; font-size: 10px; background: #fff; border: 1px solid #d6e6d6; padding: 6px; word-break: break-all; margin: 6px 0; }

/* password-strength meter */
.pw-meter { height: 4px; background: #e8e8e8; border: 1px solid #ccc; margin: 4px 0 2px; border-radius: 2px; overflow: hidden; }
.pw-meter > .bar { height: 100%; width: 0%; background: var(--fb-blue); transition: width 0.2s, background 0.2s; }

/* mode toggle */
.mode-toggle { display: flex; border: 1px solid var(--fb-border); margin: 10px 0; border-radius: 2px; overflow: hidden; }
.mode-toggle button {
  flex: 1; background: #f0f3f9; border: 0; border-right: 1px solid var(--fb-divider);
  padding: 6px 10px; font-family: inherit; font-size: 11px; cursor: pointer; color: var(--fb-text);
}
.mode-toggle button:last-child { border-right: 0; }
.mode-toggle button.active { background: var(--fb-blue); color: #fff; font-weight: 700; }

/* aside.side-panel (login/register right column) */
aside.side-panel { border-left: 1px solid var(--fb-divider); padding-left: 16px; font-size: 11.5px; }
aside.side-panel h4 { margin-top: 0; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fb-blue-3); border-bottom: 1px solid var(--fb-divider); padding-bottom: 3px; }
aside.side-panel ul { padding-left: 16px; }
aside.side-panel ul li { margin: 3px 0; }
aside.side-panel blockquote { font-style: italic; border-left: 3px solid var(--fb-blue); padding-left: 10px; margin: 10px 0; color: var(--fb-text-2); font-size: 11.5px; background: #f7f9fd; padding: 6px 10px; }
aside.side-panel .colophon { font-family: "Consolas", monospace; font-size: 10px; color: var(--fb-muted); margin-top: 14px; border-top: 1px dotted var(--fb-divider); padding-top: 6px; }
.body-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 22px; }
@media (max-width: 720px) { .body-grid { grid-template-columns: 1fr; } aside.side-panel { border-left: 0; border-top: 1px solid var(--fb-divider); padding-left: 0; padding-top: 14px; } }

.security-strip { margin-top: 10px; padding: 6px 10px; background: #f7f9fd; border: 1px solid #c0cdea; font-size: 10.5px; color: var(--fb-text-2); border-radius: 2px; }
.security-strip strong { color: var(--fb-blue-3); font-weight: 700; }
.captcha-row { display: flex; align-items: baseline; gap: 10px; }
.captcha-q { font-family: "Consolas", monospace; font-size: 12px; padding: 4px 8px; background: #fffbe0; border: 1px solid #d6c97a; border-radius: 2px; }

/* assets formerly used (hide gracefully if pages still load them) */
.ornament { display: block; width: 130px; height: auto; margin: 14px auto; opacity: 0.6; }
.now-strip { margin: 10px 0 0; padding: 6px 10px; background: #f7f9fd; border: 1px solid #c0cdea; font-size: 11px; color: var(--fb-text-2); display: flex; flex-wrap: wrap; gap: 14px; border-radius: 2px; }
.now-strip .lbl { color: var(--fb-blue-3); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; margin-right: 4px; font-size: 10px; }
.hero-banner { display: block; width: 100%; height: auto; margin: 4px 0 12px; border: 1px solid var(--fb-divider); background: #fff; border-radius: 2px; }
figure.fig { margin: 14px 0; padding: 0; }
figure.fig svg, figure.fig img { display: block; width: 100%; height: auto; border: 1px solid var(--fb-divider); background: #fff; border-radius: 2px; }
figure.fig figcaption { margin-top: 4px; font-style: italic; font-size: 11px; color: var(--fb-muted); text-align: center; }
figure.fig figcaption strong { font-style: normal; color: var(--fb-text); margin-right: 6px; text-transform: uppercase; letter-spacing: 0.04em; font-size: 10px; }
.portrait { float: right; margin: 4px 0 12px 14px; width: 280px; max-width: 100%; border: 1px solid var(--fb-divider); background: #fff; border-radius: 2px; }
.blog-mast { display: block; width: 100%; height: auto; margin: 0 0 14px; border: 1px solid var(--fb-divider); background: #fff; border-radius: 2px; }

.section + .section { margin-top: 6px; }
.sect-num { color: var(--fb-muted); font-weight: 400; margin-right: 6px; font-style: normal; }

/* responsive */
@media (max-width: 760px) {
  .frame { grid-template-columns: 1fr; padding: 0 8px; }
  .sidebar { grid-row: auto; }
  .frame > .head, .frame > .body { grid-column: 1; }
  .topbar-nav a { padding: 4px 4px; }
  .topbar-brand { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition: none !important; }
}
