/* =========================================================
   Xinsto Extension stylesheet
   Same bones as the 2006 inline <style> blocks: Verdana,
   Xinsto blue #0149CF, and the .profileheader bars.
   ========================================================= */
:root {
  --x-blue: #0149cf;
  --x-blue-dark: #00358f;
  --x-navy: #3b5998;
  --x-pale: #d8dfea;
  --x-paler: #eef1f7;
  --x-announce: #758eb5;
  --x-line: #bdc7d8;
  --x-text: #222;
  --x-muted: #666;
  --x-ok: #2f7d32;
  --x-ok-bg: #e8f5e3;
  --x-bad: #b3261e;
  --x-bad-bg: #fdecea;
}

* { box-sizing: border-box; }
html { background: #fff; }
body {
  margin: 0;
  background: #fff;
  color: var(--x-text);
  font: 12px/1.6 Verdana, Geneva, Tahoma, sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--x-blue); }
a:hover { color: var(--x-blue-dark); }
code, kbd { font: 11px/1.4 "Courier New", Courier, monospace; background: var(--x-paler); padding: 1px 4px; border: 1px solid var(--x-pale); }
h1 { font-size: 15px; margin: 0 0 10px; }
p { margin: 0 0 12px; }
.x { color: var(--x-blue); }
.muted { color: var(--x-muted); }
.small { font-size: 11px; }

/* ---------- Masthead: the logo on its blue-line strip ---------- */
/* The blue line is drawn at rows 74-82 to match the line inside the logo images. */
.masthead { background: #fff linear-gradient(to bottom, #fff 74px, #0149cf 74px, #0149cf 83px, #fff 83px); height: 93px; }
.masthead-inner { max-width: 980px; margin: 0 auto; height: 93px; position: relative; padding: 0 16px; }
.logo img { display: block; }
.whoami { position: absolute; right: 16px; top: 14px; font-size: 11px; color: var(--x-muted); }
.adslot { text-align: center; padding: 8px 16px; }

/* ---------- Two-column layout (main + nav) ---------- */
.wrap { max-width: 980px; margin: 18px auto 0; padding: 0 16px; display: grid; gap: 0; }
.layout-site    { grid-template-columns: minmax(0, 1fr) 190px; }
.layout-studiox { grid-template-columns: 190px minmax(0, 1fr); }
.main { min-width: 0; }
.layout-site .main    { padding-right: 22px; }
.layout-studiox .main { padding-left: 22px; }

.sidenav { display: flex; flex-direction: column; font-size: 12px; }
.layout-site .sidenav    { border-left: 1px solid #004acf; padding-left: 16px; text-align: center; }
.layout-studiox .sidenav { border-right: 1px solid #004acf; padding-right: 16px; }
.sidenav a { display: block; padding: 4px 6px; text-decoration: none; color: var(--x-blue); border-radius: 2px; }
.sidenav a:hover { background: var(--x-paler); }
.sidenav a.on { background: var(--x-pale); color: var(--x-navy); font-weight: bold; }

.footer { max-width: 980px; margin: 32px auto 24px; padding: 10px 16px 0; font-size: 11px; color: var(--x-muted); border-top: 1px solid var(--x-pale); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.footer .tag { font-style: italic; }

/* ---------- The 2006 header bar ---------- */
.profileheader {
  background: var(--x-pale);
  border-top: 1px solid var(--x-navy);
  color: var(--x-navy);
  font-size: 11px;
  font-weight: bold;
  margin: 0 0 10px;
  padding: 3px 8px;
}
.profileheader + * { margin-top: 0; }
.section { margin-bottom: 22px; }

/* ---------- Flash messages ---------- */
.flash { padding: 8px 10px 8px 12px; margin: 0 0 14px; border-left: 4px solid; font-size: 12px; }
.flash-ok   { background: var(--x-ok-bg); border-color: var(--x-ok); }
.flash-bad  { background: var(--x-bad-bg); border-color: var(--x-bad); }
.flash-info { background: var(--x-paler); border-color: var(--x-blue); }
.flash ul { margin: 4px 0 0 18px; padding: 0; }
.warning-head { display: flex; align-items: center; gap: 14px; font-size: 18px; }
.warning-head img { width: 48px; height: 48px; }

/* ---------- Forms ---------- */
.form { max-width: 520px; }
.field { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 12px; align-items: center; margin-bottom: 8px; }
.field > label { font-weight: bold; font-size: 11px; color: #333; }
.field .hint { grid-column: 2; font-size: 10px; color: var(--x-muted); line-height: 1.4; }
input[type=text], input[type=email], input[type=password], input[type=url], select, textarea {
  font: 12px Verdana, Geneva, sans-serif;
  border: 1px solid var(--x-line);
  padding: 5px 6px;
  width: 100%;
  background: #fff;
  color: var(--x-text);
  border-radius: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(1, 73, 207, .25); border-color: var(--x-blue); }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 10px; }
.check input { margin-top: 3px; }
.check small { display: block; color: var(--x-muted); font-size: 10px; }

.btn {
  display: inline-block;
  font: bold 11px Verdana, Geneva, sans-serif;
  color: #fff;
  background: var(--x-blue) linear-gradient(#2a6be0, var(--x-blue));
  border: 1px solid var(--x-blue-dark);
  padding: 5px 12px;
  cursor: pointer;
  text-decoration: none;
  border-radius: 2px;
}
.btn:hover { color: #fff; background: var(--x-blue-dark); }
.btn-plain { color: var(--x-navy); background: var(--x-paler) linear-gradient(#fff, var(--x-pale)); border-color: #9aa9c8; }
.btn-plain:hover { color: var(--x-navy); background: var(--x-pale); }
.btn-danger { background: var(--x-bad); border-color: #7f1b15; }
.btn-danger:hover { background: #7f1b15; }
.actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.rules { font-size: 11px; color: #444; background: var(--x-paler); border: 1px solid var(--x-pale); padding: 8px 10px; }
.chars { font-family: "Courier New", monospace; font-size: 11px; }

/* ---------- Home ---------- */
.lead { font-size: 13px; }
.lead em { color: var(--x-navy); }
.cta { background: var(--x-paler); border: 1px solid var(--x-pale); padding: 14px; margin: 16px 0 22px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.cta strong { font-size: 13px; }
.profile-list { list-style: none; padding: 0; margin: 0; }
.profile-list li { padding: 5px 0; border-bottom: 1px dotted var(--x-line); display: flex; justify-content: space-between; gap: 8px; }
.profile-list .when { color: var(--x-muted); font-size: 10px; white-space: nowrap; }
.away-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #f0b400; margin-right: 4px; vertical-align: middle; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.feature-grid div { border: 1px solid var(--x-pale); padding: 10px 12px; }
.feature-grid strong { color: var(--x-navy); display: block; margin-bottom: 4px; }
dl.faq dt { font-weight: bold; color: var(--x-navy); margin-top: 14px; }
dl.faq dd { margin: 4px 0 0; }
.archive { border-left: 3px solid var(--x-pale); padding-left: 12px; color: #333; }
.archive-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--x-muted); }

/* ---------- Studio X ---------- */
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px 22px; }
.panel .profileheader { text-align: center; }
.panel dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 11px; }
.panel dt { color: var(--x-muted); }
.panel dd { margin: 0; overflow-wrap: anywhere; }
.panel ul { margin: 0; padding-left: 16px; }
.copybox { display: flex; gap: 6px; margin: 4px 0 8px; }
.copybox input { font-family: "Courier New", monospace; font-size: 11px; }
.copybox .btn { white-space: nowrap; }
.announce { margin-bottom: 10px; }
.announce .date { font-size: 10px; color: var(--x-muted); }
.announce strong { display: block; color: var(--x-navy); }
.stat { font-size: 26px; font-weight: bold; color: var(--x-blue); letter-spacing: -1px; line-height: 1.1; }

.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.editor textarea.code {
  font: 12px/1.5 "Courier New", Courier, monospace;
  min-height: 520px;
  height: 100%;
  resize: vertical;
  tab-size: 2;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}
.preview-wrap { border: 1px solid var(--x-line); background: #f4f6fa; display: flex; flex-direction: column; min-height: 520px; }
.preview-wrap .preview-bar { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--x-muted); padding: 3px 8px; border-bottom: 1px solid var(--x-line); display: flex; justify-content: space-between; }
.preview-wrap iframe { flex: 1; width: 100%; border: 0; background: #fff; min-height: 480px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.toolbar select { width: auto; }

.colour-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 14px; margin-bottom: 12px; }
.colour-grid label { display: flex; align-items: center; gap: 8px; font-size: 11px; }
.colour-grid input[type=color] { width: 38px; height: 26px; padding: 0; border: 1px solid var(--x-line); background: #fff; cursor: pointer; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.preset { font: 11px Verdana, sans-serif; border: 1px solid var(--x-line); background: #fff; padding: 4px 8px 4px 4px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.preset:hover { border-color: var(--x-blue); }
.swatch { display: inline-flex; border: 1px solid rgba(0,0,0,.2); }
.swatch i { width: 10px; height: 16px; display: block; }
.danger-zone { border: 1px solid #e6b6b2; padding: 12px; background: #fffafa; }

/* ---------- Phones ---------- */
@media (max-width: 760px) {
  .layout-site, .layout-studiox { grid-template-columns: minmax(0, 1fr); }
  .layout-site .main, .layout-studiox .main { padding: 0; }
  .sidenav, .layout-site .sidenav, .layout-studiox .sidenav {
    flex-direction: row; flex-wrap: wrap; gap: 2px 4px;
    border: 0; border-bottom: 1px solid #004acf; padding: 0 0 8px; margin: 0 0 16px; text-align: left;
  }
  .layout-site .sidenav { order: -1; }
  .sidenav a { padding: 3px 6px; font-size: 11px; }
  .whoami { display: none; }
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor textarea.code { min-height: 340px; }
  .preview-wrap { min-height: 420px; }
  .field { grid-template-columns: minmax(0, 1fr); }
  .field .hint { grid-column: 1; }
}

/* =========================================================
   Admin CP
   ========================================================= */
.admin-badge {
  position: absolute; left: 300px; top: 40px;
  font: bold 11px Verdana, Geneva, sans-serif; letter-spacing: 1px; text-transform: uppercase;
  color: #fff; background: #222; padding: 3px 7px; border-radius: 2px;
}
.site-notice { background: #fff8d6; border-bottom: 1px solid #e8d77a; color: #4a3d00; text-align: center; padding: 7px 16px; font-size: 12px; }
.nav-sep { display: block; height: 1px; background: var(--x-pale); margin: 8px 0; }

.badge { display: inline-block; font-size: 9px; font-weight: bold; text-transform: uppercase; letter-spacing: .5px; padding: 1px 5px; border-radius: 2px; background: #eee; color: #555; border: 1px solid #ddd; white-space: nowrap; }
.badge-ok    { background: var(--x-ok-bg); color: var(--x-ok); border-color: #bfdcb6; }
.badge-warn  { background: #fff4d6; color: #8a6100; border-color: #ecd391; }
.badge-bad   { background: var(--x-bad-bg); color: var(--x-bad); border-color: #efbdb8; }
.badge-admin { background: #222; color: #fff; border-color: #222; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 22px; }
.tile { border: 1px solid var(--x-pale); border-top: 3px solid var(--x-blue); padding: 8px 10px; text-decoration: none; color: inherit; display: block; }
a.tile:hover { background: var(--x-paler); color: inherit; }
.tile .num { font-size: 24px; font-weight: bold; letter-spacing: -1px; color: var(--x-blue); line-height: 1.15; }
.tile .lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--x-muted); }
.tile.warn { border-top-color: #e0a800; } .tile.warn .num { color: #8a6100; }
.tile.bad  { border-top-color: var(--x-bad); } .tile.bad .num { color: var(--x-bad); }

.bars { display: flex; align-items: flex-end; gap: 2px; height: 70px; border-bottom: 1px solid var(--x-line); margin: 4px 0 4px; }
.bars span { flex: 1; background: var(--x-blue); min-height: 1px; opacity: .85; }
.bars span.zero { background: var(--x-pale); }
.bars-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--x-muted); margin-bottom: 22px; }

.table-wrap { overflow-x: auto; margin-bottom: 10px; }
table.data { width: 100%; border-collapse: collapse; font-size: 11px; }
table.data th { text-align: left; background: var(--x-paler); color: var(--x-navy); border-bottom: 1px solid var(--x-line); padding: 5px 8px; white-space: nowrap; font-size: 10px; text-transform: uppercase; letter-spacing: .4px; }
table.data td { border-bottom: 1px dotted var(--x-line); padding: 6px 8px; vertical-align: top; }
table.data tr:hover td { background: #fafbfd; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.filters input[type=text] { width: 220px; }
.filters select { width: auto; }
.pager { display: flex; gap: 10px; align-items: center; font-size: 11px; margin: 8px 0 18px; }
.pager span:not(.muted) { color: #aaa; }

.cols-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 26px; }
.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 4px 10px; font-size: 11px; margin-bottom: 14px; }
.kv dt { color: var(--x-muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.action-list { display: grid; gap: 10px; }
.action-box { border: 1px solid var(--x-pale); padding: 10px 12px; }
.action-box h3 { font-size: 11px; margin: 0 0 6px; color: var(--x-navy); }
.action-box p { font-size: 11px; color: #444; margin-bottom: 8px; }
.action-box .inline { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.action-box .inline input[type=text] { flex: 1; min-width: 160px; }
.secret { font: bold 14px "Courier New", monospace; background: #fff; border: 1px dashed var(--x-blue); padding: 3px 8px; user-select: all; }
textarea.source { font: 11px/1.45 "Courier New", monospace; min-height: 220px; white-space: pre; background: #fafafa; }

.report { border: 1px solid var(--x-pale); border-left: 3px solid var(--x-bad); padding: 10px 12px; margin-bottom: 12px; }
.report.closed { border-left-color: var(--x-line); opacity: .85; }
.report-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 11px; margin-bottom: 6px; }
.report-details { background: var(--x-paler); padding: 6px 8px; font-size: 11px; white-space: pre-wrap; margin-bottom: 8px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--x-line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 4px 10px; font-size: 11px; text-decoration: none; border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; }
.tabs a.on { background: #fff; border-color: var(--x-line); color: var(--x-navy); font-weight: bold; }

.report-link { font-size: 10px; color: #999 !important; margin-left: 8px; }

@media (max-width: 760px) {
  .admin-badge { left: auto; right: 16px; top: 12px; }
  .cols-2 { grid-template-columns: minmax(0, 1fr); }
  .filters input[type=text] { width: 100%; }
  .nav-sep { display: none; }
}
@media (max-width: 400px) {
  .admin-badge { top: 4px; font-size: 9px; padding: 2px 5px; }
}
button.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--x-blue); text-decoration: underline; cursor: pointer; }
button.linkish.danger { color: var(--x-bad); }

/* ---------- Legal pages ---------- */
.legal { max-width: 720px; }
.legal h2.profileheader { margin-top: 22px; }
.legal ul, .legal ol { padding-left: 20px; margin: 0 0 12px; }
.legal li { margin-bottom: 4px; }
.legal .summary { background: var(--x-paler); border: 1px solid var(--x-pale); padding: 10px 14px; margin-bottom: 8px; }
.legal .summary ul { margin-bottom: 0; }
.legal .updated { font-size: 11px; color: var(--x-muted); }
.legal .toc { font-size: 11px; columns: 2; column-gap: 24px; padding-left: 18px; }
mark.unset { background: #ffe58a; color: #5a4300; padding: 0 3px; font-weight: bold; }
@media (max-width: 760px) { .legal .toc { columns: 1; } }

/* ---------- Help Guide ---------- */
.help { min-width: 0; }
.help-chapters { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; }
.help-chapters a { font-size: 11px; padding: 3px 9px; border: 1px solid var(--x-line); text-decoration: none; border-radius: 2px; background: #fff; }
.help-chapters a.on { background: var(--x-blue); border-color: var(--x-blue-dark); color: #fff; font-weight: bold; }
.help-title { font-size: 20px; letter-spacing: -.5px; margin: 0 0 2px; }
.help-blurb { color: var(--x-muted); margin-bottom: 18px; }
.help h2.profileheader { margin-top: 26px; }
.help h3 { font-size: 12px; color: var(--x-navy); margin: 18px 0 6px; }
.help ul, .help ol { padding-left: 20px; }
.help li { margin-bottom: 4px; }
.help kbd { font: bold 10px Verdana, sans-serif; border: 1px solid var(--x-line); border-bottom-width: 2px; padding: 0 4px; border-radius: 3px; background: #fff; }
.help table.data { margin-bottom: 14px; }
.help table.data td code { white-space: nowrap; }
.help .tip { background: #fff8d6; border: 1px solid #e8d77a; padding: 8px 10px; font-size: 11px; margin: 0 0 14px; }
.help .tip strong:first-child { color: #6b5200; }
pre.snippet { font: 11px/1.5 "Courier New", Courier, monospace; background: #f7f8fb; border: 1px solid var(--x-pale); padding: 8px 10px; overflow-x: auto; margin: 0 0 14px; }
pre.snippet code { background: none; border: 0; padding: 0; }
.help-nextprev { display: flex; justify-content: space-between; gap: 10px; margin-top: 30px; padding-top: 10px; border-top: 1px solid var(--x-pale); font-weight: bold; }

.ex { border: 1px solid var(--x-line); margin: 6px 0 18px; background: #fff; }
.ex-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--x-paler); border-bottom: 1px solid var(--x-line); padding: 4px 6px 4px 10px; }
.ex-label { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--x-muted); }
.ex-actions { display: flex; gap: 4px; }
.ex-btn { padding: 2px 8px; font-size: 10px; }
.ex-panes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.ex-code { border: 0 !important; border-right: 1px solid var(--x-line) !important; font: 12px/1.5 "Courier New", Courier, monospace !important; padding: 8px 10px !important; resize: vertical; white-space: pre; overflow-x: auto; overflow-wrap: normal; background: #fbfbfd !important; tab-size: 2; min-height: 100%; }
.ex-out { min-height: var(--h); display: flex; background: #fff; }
.ex-out iframe { flex: 1; width: 100%; border: 0; min-height: var(--h); }
.ex-wait { margin: auto; color: #aaa; font-size: 11px; }
.insert-notice { margin-bottom: 10px; }
@media (max-width: 760px) {
  .ex-panes { grid-template-columns: minmax(0, 1fr); }
  .ex-code { border-right: 0 !important; border-bottom: 1px solid var(--x-line) !important; }
}
