/* Greywolf console. Brand tokens from www.wolftechcyber.com (static/css/style.css
   in /Volumes/Storage/Anthropic/wolftechcyber-website): Inter Tight, #222 dark,
   #2D8CCA accent, 8px buttons, 16px cards. The font is self-hosted (OFL). */

@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("inter-tight-latin.woff2") format("woff2");
}

:root {
  --accent: #2D8CCA;
  --accent-hover: #2479b3;
  --accent-deep: #1a6fa3;
  --dark: #222222;
  --text: #333333;
  --text-2: #666666;
  --muted: #595959;
  --page: #f5f5f5;
  --card: #ffffff;
  --light: #fafafa;
  --border: #e5e5e5;
  --line: #efefef;
  --ok-bg: #d1fae5;   --ok: #065f46;
  --bad-bg: #fee2e2;  --bad: #991b1b;
  --warn-bg: #fef3c7; --warn: #92400e;
  --info-bg: #e3f1fa; --info: #1a6fa3;
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  /* Chart series, validated with the dataviz palette checks on white:
     brand blue, then the reference orange, aqua, yellow. */
  --series-1: #2D8CCA;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--page);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

h1, h2, h3 { color: var(--dark); font-weight: 600; line-height: 1.2; margin: 0 0 0.4em; }
h1 { font-size: 1.9rem; letter-spacing: -0.5px; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

.kicker {
  display: block;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.muted { color: var(--text-2); }
.small { font-size: 0.85rem; }
.mono { font-family: var(--mono); font-size: 0.85em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 12px; }
.mt-2 { margin-top: 18px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }

/* --- header ------------------------------------------------------------------ */
.topbar {
  background: var(--dark);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 36px;
  padding: 0 40px;
  min-height: 66px;
  position: sticky;
  top: 0;
  z-index: 10;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand img { height: 32px; width: auto; display: block; }
.brand-name { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.3px; }
.brand-product {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  padding-left: 12px;
}

.nav { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.nav a {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 21px 12px 19px;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
}
.nav a:hover { color: #fff; text-decoration: none; }
.nav a.active { color: #fff; border-bottom-color: var(--accent); }

.who { display: flex; align-items: center; gap: 14px; color: rgba(255, 255, 255, 0.6); font-size: 0.85rem; }
.who form { margin: 0; }

/* --- layout ---------------------------------------------------------------------- */
.container { width: 100%; max-width: 1400px; margin: 0 auto; padding: 32px 40px 48px; flex: 1; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
             margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { margin: 0; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 30px;
  margin-bottom: 24px;
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
        padding: 24px 26px 22px; position: relative; overflow: hidden; }
/* The accent bar the website's service cards use. */
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
                background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%); }
.stat .num { font-size: 2.2rem; font-weight: 700; color: var(--dark); line-height: 1.1; }
.stat .label { color: var(--text-2); font-size: 0.85rem; margin-top: 4px; }

.banner {
  border-radius: var(--radius);
  padding: 16px 22px;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: #fff;
}
.banner strong { font-weight: 700; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 22px; margin: 0; }
dl.facts dt { color: var(--text-2); font-size: 0.85rem; }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }

/* --- top bar search ------------------------------------------------------------ */
.find { flex: 1; display: flex; justify-content: center; }
.topbar .find input[type=search] { width: 100%; max-width: 420px; background: rgba(255, 255, 255, 0.08);
              border-color: rgba(255, 255, 255, 0.15); color: #fff; }
.topbar .find input[type=search]::placeholder { color: rgba(255, 255, 255, 0.5); }

/* --- scope header (Mailprotector layout) -------------------------------------------- */
.scope-head { margin: -8px 0 24px; border-bottom: 1px solid var(--border); }
.scope-head h1 { margin-bottom: 14px; }
.crumbs { font-size: 0.85rem; margin-bottom: 10px; color: var(--text-2); }
.crumbs a { color: var(--text-2); }
.crumbs span { margin: 0 8px; color: #bbb; }
.scope-note { margin: -6px 0 14px; font-size: 0.9rem; color: var(--text-2); }
.scope-note strong { color: var(--dark); font-weight: 600; }
.scope-note .sep { margin: 0 8px; color: #bbb; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { color: var(--text); font-weight: 500; padding: 10px 14px 12px;
          border-bottom: 3px solid transparent; transition: all 0.3s ease; }
.tabs a:hover { color: var(--dark); text-decoration: none; border-bottom-color: var(--border); }
.tabs a.active { color: var(--dark); font-weight: 600; border-bottom-color: var(--accent); }

/* --- overview: tiles, composition bar, chart ------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin: 6px 0 18px; }
.tile .num, .tile .label { white-space: nowrap; }
.tile .num { font-size: 1.9rem; font-weight: 700; color: var(--dark); line-height: 1.1; }
.tile .label { font-size: 0.85rem; color: var(--text); margin-top: 2px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px;
        vertical-align: middle; }
.dot.s1, .compbar .s1 { background: var(--series-1); }
.dot.s2, .compbar .s2 { background: var(--series-2); }
.dot.s3, .compbar .s3 { background: var(--series-3); }
.dot.s4, .compbar .s4 { background: var(--series-4); }
.compbar { display: flex; gap: 2px; height: 10px; border-radius: 5px; overflow: hidden;
            margin-bottom: 14px; background: var(--line); }
.compbar span { display: block; min-width: 2px; }
.compbar .w0 { width: 0%; }
.compbar .w2 { width: 2%; }
.compbar .w4 { width: 4%; }
.compbar .w6 { width: 6%; }
.compbar .w8 { width: 8%; }
.compbar .w10 { width: 10%; }
.compbar .w12 { width: 12%; }
.compbar .w14 { width: 14%; }
.compbar .w16 { width: 16%; }
.compbar .w18 { width: 18%; }
.compbar .w20 { width: 20%; }
.compbar .w22 { width: 22%; }
.compbar .w24 { width: 24%; }
.compbar .w26 { width: 26%; }
.compbar .w28 { width: 28%; }
.compbar .w30 { width: 30%; }
.compbar .w32 { width: 32%; }
.compbar .w34 { width: 34%; }
.compbar .w36 { width: 36%; }
.compbar .w38 { width: 38%; }
.compbar .w40 { width: 40%; }
.compbar .w42 { width: 42%; }
.compbar .w44 { width: 44%; }
.compbar .w46 { width: 46%; }
.compbar .w48 { width: 48%; }
.compbar .w50 { width: 50%; }
.compbar .w52 { width: 52%; }
.compbar .w54 { width: 54%; }
.compbar .w56 { width: 56%; }
.compbar .w58 { width: 58%; }
.compbar .w60 { width: 60%; }
.compbar .w62 { width: 62%; }
.compbar .w64 { width: 64%; }
.compbar .w66 { width: 66%; }
.compbar .w68 { width: 68%; }
.compbar .w70 { width: 70%; }
.compbar .w72 { width: 72%; }
.compbar .w74 { width: 74%; }
.compbar .w76 { width: 76%; }
.compbar .w78 { width: 78%; }
.compbar .w80 { width: 80%; }
.compbar .w82 { width: 82%; }
.compbar .w84 { width: 84%; }
.compbar .w86 { width: 86%; }
.compbar .w88 { width: 88%; }
.compbar .w90 { width: 90%; }
.compbar .w92 { width: 92%; }
.compbar .w94 { width: 94%; }
.compbar .w96 { width: 96%; }
.compbar .w98 { width: 98%; }
.compbar .w100 { width: 100%; }
.legend { list-style: none; display: flex; gap: 18px; padding: 0; margin: 0 0 6px;
           font-size: 0.85rem; color: var(--text); }
svg.chart { width: 100%; height: auto; display: block; }
svg.chart .grid { stroke: var(--line); stroke-width: 1; }
svg.chart .baseline { stroke: #cfcfcf; stroke-width: 1; }
svg.chart .axis { fill: var(--text-2); font-size: 11px; font-family: inherit; }
svg.chart .hit { fill: transparent; }
svg.chart .s1 { fill: var(--series-1); }
svg.chart .s2 { fill: var(--series-2); }
svg.chart .s3 { fill: var(--series-3); }
svg.chart .s4 { fill: var(--series-4); }
details summary { cursor: pointer; }

/* --- end-user switches and settings ---------------------------------------------------- */
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 20px;
               padding: 14px 0; border-bottom: 1px solid var(--line); }
.switch-row:last-child { border-bottom: 0; }
.setting-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.setting-form input[type=number] { width: 100px; }
.setting-form input[type=text] { width: 200px; }
.setting-form .days { display: flex; gap: 10px; flex-wrap: wrap; padding-right: 12px;
                      border-right: 1px solid var(--border); }
table.settings td { vertical-align: middle; }

/* --- tables ---------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; margin: 0 -6px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover td { background: var(--light); }
td.subject { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.addr { max-width: 240px; overflow-wrap: anywhere; }
.empty { color: var(--text-2); padding: 24px 0; text-align: center; }

/* --- badges and chips ---------------------------------------------------------------------- */
.badge, .chip {
  display: inline-block;
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
}
.badge { font-size: 0.76rem; padding: 3px 10px; border-radius: 999px; }
.chip { font-size: 0.72rem; padding: 2px 8px; border-radius: 6px; margin: 1px 2px 1px 0; }
.is-success { background: var(--ok-bg); color: var(--ok); }
.is-danger { background: var(--bad-bg); color: var(--bad); }
.is-warning { background: var(--warn-bg); color: var(--warn); }
.is-primary { background: var(--info-bg); color: var(--info); }
.is-neutral { background: var(--line); color: var(--muted); }
.is-shadow { background: transparent; color: var(--muted); border: 1px dashed #bdbdbd;
             padding: 2px 8px; }

/* --- buttons and forms ------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.2;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--accent);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }
.btn-outline { background: transparent; color: var(--accent-hover); }
.btn-outline:hover { background: var(--accent); color: #fff; }
.btn-outline-white { background: transparent; border-color: rgba(255, 255, 255, 0.5); color: #fff; }
.btn-outline-white:hover { background: #fff; border-color: #fff; color: var(--dark); }
.btn-danger { background: #fff; color: var(--bad); border-color: #f3c4c4; }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg { padding: 15px 34px; font-size: 1.05rem; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; margin: 0; }

.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 0.78rem; font-weight: 600; color: var(--text-2); }
input[type=text], input[type=search], input[type=number], select, textarea {
  font: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  min-width: 0;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible {
  outline: 3px solid var(--dark);
  outline-offset: 1px;
}
.field.grow { flex: 1; min-width: 220px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 0.9rem; }

/* --- messages --------------------------------------------------------------------------------- */
.flash { border-radius: var(--radius-sm); padding: 12px 18px; margin-bottom: 14px; font-weight: 500; }
.flash-success { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--bad-bg); color: var(--bad); }
.flash-info { background: var(--info-bg); color: var(--info); }

pre.body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  font-family: var(--mono);
  font-size: 0.85rem;
  max-height: 70vh;
  overflow: auto;
}

/* --- sign-in ---------------------------------------------------------------------------------- */
.narrow { max-width: 620px; margin: 6vh auto 0; }
.signin { max-width: 440px; margin: 9vh auto 0; overflow: hidden; padding: 0; }
.signin-head { background: var(--dark); color: #fff; padding: 34px 36px 28px; text-align: center; }
.signin-head img { height: 64px; width: auto; margin-bottom: 14px; }
.signin-head h1 { color: #fff; font-size: 1.5rem; margin: 0; }
.signin-body { padding: 30px 36px 34px; text-align: center; }
.signin-body p { color: var(--text-2); margin: 0 0 22px; }

.footer { text-align: center; color: var(--text-2); font-size: 0.8rem; padding: 18px 20px 26px; }
.footer strong { color: var(--dark); font-weight: 600; }

@media (max-width: 900px) {
  /* Not pinned: two rows of header would eat a phone screen. */
  .topbar { padding: 10px 16px; gap: 10px 18px; position: static; }
  .nav a { padding: 8px 8px; }
  .container { padding: 22px 16px 36px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .find { order: 3; flex-basis: 100%; }
  .switch-row { flex-direction: column; align-items: flex-start; }
  .card { padding: 20px 18px; }

  /* Many-column tables keep their columns and scroll sideways in the card
     instead of squeezing addresses down to a letter per line. */
  table.wide { min-width: 760px; }

  /* table.cards: each row becomes a stacked card. The header row stays for
     screen readers only; the cards label their own fields. */
  table.cards, table.cards tbody { display: block; }
  table.cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden;
                      clip: rect(0 0 0 0); white-space: nowrap; }
  table.cards tr { display: grid; gap: 5px 10px; align-items: center; padding: 14px 2px;
                   border-bottom: 1px solid var(--line); }
  table.cards tr:last-child { border-bottom: 0; }
  table.cards td { display: block; padding: 0; border: 0; min-width: 0; max-width: none; }
  table.cards tbody tr:hover td { background: none; }
  table.cards td.empty { grid-column: 1 / -1; padding: 12px 0; }
  table.cards .c-when { font-weight: 600; }
  table.cards .c-from, table.cards .c-to, table.cards .c-held { line-height: 1.4; }
  table.cards .c-from::before, table.cards .c-to::before, table.cards .c-held::before,
  table.cards .c-score::before, table.cards .c-exp::before {
    color: var(--text-2); font-family: var(--sans); font-size: 0.78rem; font-weight: 600;
    margin-right: 6px;
  }
  table.cards .c-from::before { content: "From"; }
  table.cards .c-to::before { content: "To"; }
  table.cards .c-held::before { content: "For"; }
  table.cards .c-score::before { content: "Score"; }
  table.cards .c-exp::before { content: "Expires"; }
  table.cards .c-subj {
    color: var(--dark); white-space: normal; overflow: hidden;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  }
  table.cards .c-score, table.cards .c-exp, table.cards .c-cust { font-size: 0.85rem; }
  table.cards .c-score { color: var(--text-2); justify-self: end; }
  table.cards .c-result { justify-self: end; white-space: normal; text-align: right; }
  table.cards .c-act { justify-self: end; white-space: normal; display: flex; gap: 8px;
                       flex-wrap: wrap; justify-content: flex-end; }

  /* Message log: time, In/Out, result / From / To / subject / customer, score. */
  table.msg-cards tr {
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-areas: "when dir result" "from from from" "to to to"
                         "subj subj subj" "cust cust score";
  }
  .msg-cards .c-when { grid-area: when; }
  .msg-cards .c-dir { grid-area: dir; }
  .msg-cards .c-result { grid-area: result; }
  .msg-cards .c-from { grid-area: from; }
  .msg-cards .c-to { grid-area: to; }
  .msg-cards .c-subj { grid-area: subj; }
  .msg-cards .c-cust { grid-area: cust; }
  .msg-cards .c-score { grid-area: score; }

  /* Quarantine: time, score / From / held for / subject / expires, Release. */
  table.q-cards tr {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "when score" "from from" "held held" "subj subj" "exp act";
  }
  .q-cards .c-when { grid-area: when; }
  .q-cards .c-score { grid-area: score; }
  .q-cards .c-from { grid-area: from; }
  .q-cards .c-held { grid-area: held; }
  .q-cards .c-subj { grid-area: subj; }
  .q-cards .c-exp { grid-area: exp; }
  .q-cards .c-act { grid-area: act; }

  /* Client My quarantine: time, why / From / subject / buttons. */
  table.my-cards tr {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "when why" "from from" "subj subj" "act act";
  }
  .my-cards .c-when { grid-area: when; }
  .my-cards .c-why { grid-area: why; font-size: 0.85rem; color: var(--text-2); }
  .my-cards .c-from { grid-area: from; }
  .my-cards .c-subj { grid-area: subj; }
  .my-cards .c-act { grid-area: act; justify-self: stretch; justify-content: flex-start; }
}

@media (max-width: 700px) {
  /* One header row on a phone: logo and Sign out, search below. */
  .topbar { padding: 10px 16px 12px; gap: 10px 12px; }
  .brand { gap: 10px; }
  .brand img { height: 28px; }
  .brand-product { padding-left: 10px; }
  .who { margin-left: auto; }
  .who span { display: none; }
  .container { padding: 16px 12px 32px; }
  .card { padding: 16px 14px; margin-bottom: 16px; }
  h1 { font-size: 1.5rem; }
  .filters .field.grow { flex-basis: 100%; }
  /* 16px keeps phones from zooming in when a field gets focus. */
  input[type=text], input[type=search], input[type=number], select, textarea { font-size: 16px; }
}

/* Scanner relay page (relay.html). */
.secret { font-family: var(--mono); font-size: 1.05rem; user-select: all; word-break: break-all; }
.secret-card { border: 2px solid var(--accent); }
.dns-record { margin-bottom: 4px; word-break: break-all; }
.copy-btn { padding: 2px 10px; margin-left: 6px; vertical-align: middle; }

/* Secure mail portal (greywolf/console/securemail.py) */
.secure-frame { display: block; width: 100%; height: 420px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: #fff; }
.secure-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.95rem;
  line-height: 1.5; border-top: 1px solid var(--line); padding-top: 14px; }
details > summary { cursor: pointer; color: var(--accent-hover); }
