:root {
  --bg: #000;
  --raised: #141414;
  --hover: #1c1c1c;
  --border: #28323a;
  --text: #fff;
  --muted: #9eabb5;
  --faint: #6f7d87;
  --good: #4bcb82;
  --bad: #e35d62;
  --warn: #d5a34e;
  --accent: #7893a7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif;
}

a { color: var(--text); }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
  padding: 18px 16px;
  border-bottom: 1px solid var(--border);
}

.brand { font-weight: 700; letter-spacing: 0.08em; text-decoration: none; }

nav { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover, nav a.on { color: var(--text); }
nav button { font-size: 14px; }

main { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; }

h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 28px 0 10px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 13px; }

.box {
  border: 1px solid var(--border);
  background: var(--raised);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 14px;
}

.packages { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.package .price { font-size: 28px; font-weight: 600; margin: 4px 0; }
.package ul { padding-left: 18px; color: var(--muted); margin: 8px 0 16px; }

form.narrow { max-width: 380px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
input {
  width: 100%;
  padding: 9px 10px;
  background: #0a0a0a;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  font: inherit;
}
input:focus { outline: 1px solid var(--accent); }

button {
  font: inherit;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--hover);
  color: var(--text);
  padding: 8px 14px;
}
button.primary { background: var(--text); color: #000; border-color: var(--text); font-weight: 600; }
button.link { background: none; border: none; color: var(--muted); padding: 0; text-decoration: underline; }
button:disabled { opacity: 0.5; cursor: default; }
form button { margin-top: 16px; }

.pay-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0 14px; }
.value {
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 17px;
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  word-break: break-all;
  flex: 1 1 260px;
}
.value.big { font-size: 24px; }

.key {
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 18px;
  letter-spacing: 0.04em;
}

.tag { font-size: 12px; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--border); color: var(--muted); }
.tag.good { color: var(--good); border-color: var(--good); }
.tag.bad { color: var(--bad); border-color: var(--bad); }
.tag.warn { color: var(--warn); border-color: var(--warn); }

.msg { padding: 10px 12px; border-radius: 4px; margin: 12px 0; border: 1px solid var(--border); }
.msg.error { border-color: var(--bad); color: var(--bad); }
.msg.ok { border-color: var(--good); color: var(--good); }
.msg.warn { border-color: var(--warn); color: var(--warn); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--faint); font-weight: 400; }
.scroll { overflow-x: auto; }

ol.steps { padding-left: 20px; color: var(--muted); }
ol.steps li { margin-bottom: 6px; }

.foot { max-width: 960px; margin: 0 auto; padding: 18px 16px 32px; color: var(--faint); font-size: 12px; border-top: 1px solid var(--border); }

.counter { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.counter div { border: 1px solid var(--border); border-radius: 4px; padding: 8px 12px; min-width: 96px; }
.counter strong { display: block; font-size: 20px; }
.counter span { color: var(--faint); font-size: 12px; }
td .key { font-size: 14px; }

.code-input { font-size: 28px; letter-spacing: 0.3em; text-align: center; font-family: Consolas, "Cascadia Mono", monospace; }
select { width: 100%; padding: 9px 10px; background: #0a0a0a; color: var(--text); border: 1px solid var(--border); border-radius: 4px; font: inherit; }

.rig-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 12px 0; }
.rig-facts span { display: block; color: var(--faint); font-size: 12px; }
.rig-facts strong { font-size: 17px; }
.rig-facts em { display: block; color: var(--warn); font-style: normal; font-size: 12px; }
.rig-actions select { width: auto; }
.chart { width: 100%; height: 90px; color: var(--good); display: block; margin-top: 6px; }
.chart-scale { display: flex; justify-content: space-between; font-size: 12px; }
@media (max-width: 600px) {
  .rig-actions button, .rig-actions select { flex: 1 1 45%; }
  h1 { font-size: 20px; }
}

.rig-details { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
table.log td { padding: 6px 4px; }
table.log td:first-child { white-space: nowrap; width: 1%; padding-right: 14px; }
.bad-text { color: var(--bad); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.days { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.days label { margin: 8px 0 0; color: var(--text); font-size: 14px; }
.send-to { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 0; }
.send-to > div { border: 1px solid var(--border); border-radius: 4px; padding: 12px; }
.send-to p { margin: 4px 0 8px; }
.send-to button { margin-top: 0; }
@media (max-width: 600px) {
  .send-to { grid-template-columns: 1fr; }
}

/* Phone navigation: main pages in a bottom bar, the rest behind More. */
#bottomnav { display: none; }
@media (max-width: 700px) {
  .top nav { display: none; }
  body.has-bottomnav main { padding-bottom: 96px; }
  body.has-bottomnav .foot { padding-bottom: 84px; }
  #bottomnav:not([hidden]) {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 20;
    background: var(--bg);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  #bottomnav a, #bottomnav button {
    flex: 1 1 0;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: none; border: none; border-radius: 0; padding: 4px 0;
    color: var(--faint); text-decoration: none; font-size: 11px;
  }
  #bottomnav .on { color: var(--text); }
  #more-sheet .sheet-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, 0.6); }
  #more-sheet .sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 31;
    background: var(--raised); border-top: 1px solid var(--border);
    border-radius: 10px 10px 0 0;
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
    display: flex; flex-direction: column;
  }
  #more-sheet .sheet a, #more-sheet .sheet button {
    display: block; text-align: left; width: 100%;
    padding: 14px 4px; font-size: 16px;
    color: var(--text); text-decoration: none;
    background: none; border: none; border-bottom: 1px solid var(--border); border-radius: 0;
  }
  #more-sheet .sheet a.on { color: var(--accent); }
  #more-sheet .sheet .sheet-cancel { border-bottom: none; color: var(--muted); text-align: center; margin-top: 4px; }
}

/* Landing page */
.hero { padding: 20px 0 8px; }
.hero h1 { font-size: 34px; line-height: 1.15; margin: 0 0 14px; max-width: 760px; }
.hero .lead { font-size: 17px; color: var(--muted); max-width: 720px; margin-bottom: 18px; }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 26px 0 8px; }
.facts div { border: 1px solid var(--border); border-radius: 6px; padding: 14px; }
.facts strong { display: block; font-size: 22px; }
.facts span { color: var(--faint); font-size: 13px; }
ol.how { padding-left: 22px; }
ol.how li { margin-bottom: 12px; color: var(--muted); }
ol.how li strong { color: var(--text); }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.feature-grid ul { padding-left: 18px; margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.feature-grid li { margin-bottom: 6px; }
table.compare td:first-child { width: 34%; }
details.faq { border-bottom: 1px solid var(--border); padding: 12px 0; }
details.faq summary { cursor: pointer; font-weight: 600; }
details.faq p { color: var(--muted); margin: 8px 0 0; }
.box.cta { margin-top: 28px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (max-width: 700px) {
  .hero h1 { font-size: 26px; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  body:not(.has-bottomnav) .top nav { display: flex; gap: 12px; }
  body:not(.has-bottomnav) .top { flex-wrap: wrap; }
}

/* The landing page uses the whole screen width. */
body.wide .top,
body.wide main,
body.wide .foot { max-width: none; padding-left: clamp(16px, 4vw, 64px); padding-right: clamp(16px, 4vw, 64px); }
body.wide .hero h1 { max-width: 980px; font-size: clamp(30px, 3.2vw, 46px); }
body.wide .hero .lead { max-width: 900px; font-size: clamp(17px, 1.3vw, 20px); }
body.wide .feature-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
body.wide .packages { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
@media (min-width: 1400px) {
  body.wide .feature-grid { grid-template-columns: repeat(3, 1fr); }
  body.wide .packages { grid-template-columns: repeat(7, 1fr); }
}
