/* No Contact Mail Server - one stylesheet for every page. Light and dark follow the device. */
:root {
  --bg: #f3f5fa; --card: #ffffff; --text: #18202e; --muted: #5b6577; --line: #e1e6ef; --field: #ffffff;
  --brand: #1a5fd0; --brand-dark: #144aa6; --brand-text: #ffffff; --soft: #eaf1fd;
  --good: #17713f; --good-bg: #e3f5ea; --bad: #b3261e; --bad-bg: #fdeceb; --chip: #eef1f6;
  --hero-a: #2a6bd6; --hero-b: #123a7c;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1219; --card: #171c27; --text: #e8ecf4; --muted: #9aa5b8; --line: #283142; --field: #10151e;
    --brand: #6ea2ff; --brand-dark: #8db6ff; --brand-text: #0b1220; --soft: #1b2740;
    --good: #7ad79e; --good-bg: #153223; --bad: #ff9a92; --bad-bg: #3d1f1c; --chip: #232c3c;
    --hero-a: #1f4f9f; --hero-b: #0d2752;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; margin: 0; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }

/* ---- the bar at the top of every page ---- */
header.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.bar { max-width: 1040px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none;
  font-weight: 700; font-size: 1.08rem; letter-spacing: -.01em; margin-right: auto; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
nav { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; }
nav form { margin: 0; }
.navlink { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; padding: 7px 11px; border-radius: 9px; }
.navlink:hover { color: var(--text); background: var(--chip); }
.navlink.on { color: var(--brand); background: var(--soft); }

/* who is signed in */
.who { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--text);
  padding: 4px 12px 4px 4px; border: 1px solid var(--line); border-radius: 99px; background: var(--card); max-width: 100%; }
.who:hover { border-color: var(--brand); }
.avatar { position: relative; flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--brand); color: var(--brand-text); font-weight: 700; font-size: .95rem; }
.who .avatar::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%;
  background: #22b566; border: 2px solid var(--card); }
.avatar.small { width: 26px; height: 26px; font-size: .8rem; vertical-align: middle; margin-right: 4px; }
.who-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.who-text small { color: var(--good); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.who-text strong { font-size: .92rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }

/* ---- page body ---- */
main { width: 100%; max-width: 1040px; margin: 0 auto; padding: 20px 16px 8px; flex: 1; }
main.narrow { max-width: 460px; padding-top: 40px; }
.page-head { margin: 8px 0 18px; }
.page-head h1 { font-size: 1.7rem; }
.page-head p { color: var(--muted); margin: 4px 0 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  margin: 0 0 18px; box-shadow: var(--shadow); }
.card h2 { font-size: 1.2rem; margin-bottom: 4px; }
.card h3 { font-size: 1rem; }
.form-card h1 { font-size: 1.45rem; margin-bottom: 6px; }
p.hint { color: var(--muted); margin: 0 0 16px; font-size: .94rem; }
p.hint.after { margin: 16px 0 0; }
p.empty { color: var(--muted); background: var(--bg); border: 1px dashed var(--line); border-radius: 10px; padding: 14px; margin: 0; }
.sub-form { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ---- download page ---- */
.hero { text-align: center; color: #fff; padding: 44px 20px 40px; border-radius: 20px; margin-bottom: 18px;
  background: radial-gradient(1200px 400px at 50% -120px, rgba(255, 255, 255, .22), transparent 60%),
              linear-gradient(135deg, var(--hero-a), var(--hero-b)); box-shadow: var(--shadow); }
.hero img { width: 104px; height: 104px; border-radius: 24px; box-shadow: 0 10px 30px rgba(0, 0, 0, .28); }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.5rem); margin: 18px 0 6px; }
.hero .tagline { font-size: 1.1rem; opacity: .92; margin: 0 auto 24px; max-width: 34ch; }
.hero .meta { font-size: .9rem; opacity: .8; margin: 14px 0 0; }
.hero .button.big { background: #fff; border-color: #fff; color: #123a7c; box-shadow: 0 6px 18px rgba(0, 0, 0, .22); }
.hero .button.big:hover { background: #eef4ff; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  border-top: 3px solid var(--brand); }
.feature h3 { font-size: 1.02rem; margin-bottom: 6px; }
.feature p { margin: 0; color: var(--muted); font-size: .94rem; }
ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 14px 0 0; }
ol.steps li { counter-increment: step; position: relative; padding: 4px 0 14px 46px; min-height: 40px; }
ol.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--soft); color: var(--brand); font-weight: 700; }

/* ---- dashboard ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; }
.stat small { color: var(--muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.stat strong { font-size: 1.7rem; line-height: 1.2; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .88rem; }
.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 11px 14px; vertical-align: middle; white-space: nowrap; }
thead th { background: var(--bg); color: var(--muted); font-weight: 700; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; }
tbody tr { border-top: 1px solid var(--line); }
tbody tr:hover { background: color-mix(in srgb, var(--soft) 45%, transparent); }
td.wrap { white-space: normal; min-width: 180px; color: var(--muted); }
td.row-actions { text-align: right; }
td form { display: inline; }
.chip { display: inline-block; border-radius: 99px; padding: 2px 10px; font-size: .78rem; font-weight: 700;
  background: var(--chip); color: var(--muted); vertical-align: middle; }
.chip.good { background: var(--good-bg); color: var(--good); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }

/* ---- buttons and forms ---- */
button, .button { display: inline-block; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: center;
  border: 1px solid var(--brand); background: var(--brand); color: var(--brand-text);
  border-radius: 10px; padding: 9px 18px; transition: background .15s, border-color .15s, transform .05s; }
button:hover, .button:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
button:active, .button:active { transform: translateY(1px); }
button.plain, .button.plain { background: var(--card); color: var(--text); border-color: var(--line); font-weight: 600; }
button.plain:hover, .button.plain:hover { background: var(--chip); border-color: var(--line); }
button.danger { background: var(--card); color: var(--bad); border-color: var(--line); }
button.danger:hover { background: var(--bad-bg); border-color: var(--bad); }
button.small, .button.small { padding: 5px 12px; font-size: .88rem; border-radius: 8px; }
.button.big { font-size: 1.1rem; padding: 14px 30px; border-radius: 14px; }
label { display: block; font-weight: 600; margin: 16px 0 6px; font-size: .95rem; }
.help, label.check span small { display: block; color: var(--muted); font-weight: 400; font-size: .87rem; margin-top: 2px; }
label.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; padding: 12px 14px; margin: 10px 0 0;
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
label.check:hover { border-color: var(--brand); }
label.check input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--brand); }
input[type=text], input[type=password], select, textarea, input[type=file] { width: 100%; font: inherit;
  color: var(--text); background: var(--field); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
textarea { min-height: 96px; resize: vertical; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 18px; align-items: start; }
.actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.flash { border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; font-weight: 600; border: 1px solid transparent; }
.flash.good { background: var(--good-bg); color: var(--good); border-color: color-mix(in srgb, var(--good) 25%, transparent); }
.flash.bad { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }

footer { max-width: 1040px; width: 100%; margin: 0 auto; padding: 18px 16px 28px; color: var(--muted); font-size: .85rem;
  display: flex; gap: 6px 20px; justify-content: space-between; flex-wrap: wrap; }

@media (max-width: 560px) {
  .who-text strong { max-width: 130px; }
  .card { padding: 18px 16px; }
  .hero { padding: 34px 16px 30px; border-radius: 16px; }
  td.row-actions { text-align: left; }
}
