/* eSIM portal — "developer tool" aesthetic: warm paper canvas, one orange accent,
   hairline-bordered cards, monospace for technical labels. Light-only by intent. */

:root {
  --paper:      #faf7f2;   /* warm off-white background */
  --surface:    #ffffff;   /* cards sit just above the paper */
  --ink:        #1a1815;   /* near-black charcoal for headings */
  --muted:      #6f6a62;   /* secondary / body copy */
  --faint:      #9a948a;   /* captions, timestamps */
  --hairline:   #e7e1d6;   /* thin borders between blocks */
  --accent:     #e8482b;   /* the one strong colour */
  --accent-ink: #b7351d;   /* accent text on paper, for contrast */
  --code-bg:    #1c1a17;   /* dark panels */
  --code-fg:    #ece7de;
  --code-accent:#ff7a5c;
  --radius:     6px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

body {
  font: 15px/1.6 var(--sans);
  color: var(--ink);
  background: var(--paper);
  margin: 0;
  padding: 0 1.25rem 6rem;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 52rem; margin: 0 auto; }

/* ---- header ---- */

header.site {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-weight: 650;
  font-size: 1.05rem;
  letter-spacing: -.01em;
  color: var(--ink);
  text-decoration: none;
}
.brand .mark {
  width: 1.3rem;
  height: 1.3rem;
  color: var(--accent);
  flex: none;
}
.header-links { font-size: .875rem; color: var(--muted); display: flex; align-items: center; gap: .75rem; }
.header-links a:not(.btn) { color: var(--muted); text-decoration: none; }
.header-links a:not(.btn):hover { color: var(--ink); }

/* ---- type ---- */

h1 { font-size: 1.5rem; font-weight: 650; letter-spacing: -.02em; margin: 0 0 .4rem; }
h2 {
  font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em;
  color: var(--faint); margin: 2.5rem 0 .9rem; font-family: var(--mono);
}
p { margin: 0 0 1rem; color: var(--muted); }
.lede { font-size: 1.02rem; color: var(--muted); margin-bottom: 2rem; }
a { color: var(--accent-ink); }
code { font-family: var(--mono); font-size: .85em; }

/* ---- footer ---- */

footer.site {
  display: flex; flex-wrap: wrap; gap: 1.1rem; align-items: center;
  margin-top: 4rem; padding-top: 1.15rem;
  border-top: 1px solid var(--hairline);
  font-size: .82rem;
}
footer.site a { color: var(--muted); text-decoration: none; }
footer.site a:hover { color: var(--ink); }

/* ---- legal pages ---- */

.prose { max-width: 40rem; }
.prose h1 { margin-bottom: .3rem; }
.prose h2 { margin-top: 2.2rem; }
.prose ul { padding-left: 1.15rem; margin: 0 0 1rem; color: var(--muted); }
.prose li { margin-bottom: .4rem; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose .kv th { padding-right: 1.5rem; }
.updated { font-family: var(--mono); font-size: .75rem; color: var(--faint);
  margin-bottom: 2rem; }

/* ---- landing ---- */

.hero { margin: 1rem 0 1rem; }
.eyebrow { font-family: var(--mono); font-size: .78rem; color: var(--accent-ink); margin: 0 0 .8rem; }
.hero h1 { font-size: 2rem; line-height: 1.15; max-width: 20ch; }
.hero .lede { max-width: 46ch; }
.hero .search { margin-bottom: .7rem; }
.hero #plan-results:not(:empty) { margin: 1.2rem 0; }

.label { font-family: var(--mono); font-size: .75rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--faint); margin: 1.8rem 0 .5rem; }
.codeblock.endpoint { user-select: all; white-space: nowrap; }
.codeblock.endpoint .k { color: var(--faint); margin-right: .5rem; user-select: none; }

/* example conversation — light transcript, mono for the tool calls */
.convo { border: 1px solid var(--hairline); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; }
.turn { padding: .95rem 1.1rem; border-bottom: 1px solid var(--hairline); }
.turn:last-child { border-bottom: 0; }
.turn.bot { background: color-mix(in srgb, var(--accent) 2.5%, transparent); }
.turn .who { font-family: var(--mono); font-size: .7rem; text-transform: uppercase;
  letter-spacing: .07em; color: var(--faint); }
.turn.bot .who { color: var(--accent-ink); }
.turn p { margin: .4rem 0 0; color: var(--ink); }

.cta { display: flex; gap: .6rem; margin: 2rem 0; }

@media (max-width: 34rem) {
  .hero h1 { font-size: 1.6rem; }
}

/* ---- search ---- */

.search { position: relative; }
.search input[type=search] {
  width: 100%;
  font: 1rem/1.4 var(--sans);
  padding: .8rem 1rem .8rem 2.4rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}
.search input[type=search]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.search .icon {
  position: absolute; left: .85rem; top: 50%; transform: translateY(-50%);
  width: 1rem; height: 1rem; color: var(--faint); pointer-events: none;
}
.search .spinner { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: .75rem; color: var(--accent-ink); }
.htmx-request .spinner { display: inline; }
.spinner { display: none; }

/* ---- filter chips ---- */

.filters { display: grid; gap: .45rem; margin: 1rem 0; }
.fgroup { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.flabel { display: inline-flex; align-items: center; gap: .35rem; margin-right: .3rem;
  font-family: var(--mono); font-size: .72rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--faint); min-width: 4.4rem; }
.flabel svg { width: .95rem; height: .95rem; }
.chip {
  cursor: pointer; font-family: var(--mono); font-size: .76rem; line-height: 1;
  padding: .35rem .6rem; border: 1px solid var(--hairline); border-radius: 999px;
  background: var(--surface); color: var(--muted);
}
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip:hover { border-color: var(--muted); }
.chip:has(:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip:has(:focus-visible) { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }

/* ---- plan cards ---- */

.plan-grid { display: grid; gap: .6rem; }
.plan {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1.05rem;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--surface);
}
.plan:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--hairline)); }
.plan .name { font-weight: 550; color: var(--ink); margin: 0 0 .2rem; }
.plan .meta { font-family: var(--mono); font-size: .78rem; color: var(--muted); margin: 0;
  display: flex; gap: .6rem; flex-wrap: wrap; }
.plan .meta .tag {
  border: 1px solid var(--hairline); border-radius: 3px; padding: 0 .35rem;
  color: var(--faint);
}
.plan .buy { display: flex; flex-direction: column; align-items: flex-end; gap: .4rem; }
.plan .price { font-family: var(--mono); font-weight: 600; color: var(--ink); font-size: .95rem; }

.empty { padding: 2rem 1rem; text-align: center; color: var(--faint);
  border: 1px dashed var(--hairline); border-radius: var(--radius); font-family: var(--mono);
  font-size: .85rem; }

/* ---- buttons ---- */

.btn {
  font: 550 .82rem/1 var(--sans);
  padding: .5rem .85rem;
  border-radius: var(--radius);
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.danger { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 45%, var(--hairline)); background: transparent; }
.btn.danger:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }

/* ---- orders table ---- */

.orders { width: 100%; border-collapse: collapse; }
.orders th {
  text-align: left; font-family: var(--mono); font-size: .72rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .05em; color: var(--faint);
  padding: .5rem .6rem; border-bottom: 1px solid var(--hairline);
}
.orders td { padding: .7rem .6rem; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.orders tr:hover td { background: color-mix(in srgb, var(--accent) 3%, transparent); }

/* status pill */
.status {
  font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
  padding: .15rem .45rem; border-radius: 3px; border: 1px solid var(--hairline); color: var(--muted);
}
.status.fulfilled { color: #1f7a3d; border-color: color-mix(in srgb, #1f7a3d 30%, var(--hairline)); }
.status.pending, .status.paid, .status.provisioning { color: var(--accent-ink);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--hairline)); }
.status.failed, .status.refunded, .status.cancelled { color: var(--faint); }

/* ---- order detail ---- */

.card {
  border: 1px solid var(--hairline); border-radius: var(--radius);
  background: var(--surface); padding: 1.25rem; margin-bottom: 1.25rem;
}
.qr { max-width: 14rem; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--hairline); background:#fff; }
.codeblock {
  font-family: var(--mono); font-size: .82rem; line-height: 1.5;
  background: var(--code-bg); color: var(--code-fg);
  padding: .8rem 1rem; border-radius: var(--radius); word-break: break-all;
  overflow-x: auto;
}
.codeblock .k { color: var(--code-accent); }
.kv { width: 100%; border-collapse: collapse; }
.kv th { text-align: left; font-family: var(--mono); font-size: .78rem; color: var(--faint);
  font-weight: 500; padding: .45rem .6rem .45rem 0; white-space: nowrap; vertical-align: top; }
.kv td { padding: .45rem 0; }

.meter { height: .5rem; border-radius: 99px; background: var(--hairline); overflow: hidden; margin: .5rem 0; }
.meter > span { display: block; height: 100%; background: var(--accent); }

.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: .85rem; }

/* ---- flash messages ---- */
.msg { padding: .7rem .95rem; border-radius: var(--radius); border: 1px solid var(--hairline);
  background: var(--surface); margin-bottom: 1rem; font-size: .9rem; }
.msg.error { border-color: color-mix(in srgb, var(--accent) 45%, var(--hairline));
  color: var(--accent-ink); }
.msg.success { border-color: color-mix(in srgb, #1f7a3d 35%, var(--hairline)); }

.back { font-family: var(--mono); font-size: .8rem; text-decoration: none; color: var(--muted); }
.back:hover { color: var(--ink); }

/* ---- guides ---- */
/* Long-form articles. h1/h2/ul/strong come from .prose above; this adds the
   elements the legal pages never needed: subheads, numbered steps, wide tables
   and pull-out notes. */

.prose h3 {
  font-size: .95rem; font-weight: 650; color: var(--ink);
  margin: 1.8rem 0 .5rem; letter-spacing: -.01em;
}
.prose ol { padding-left: 1.3rem; margin: 0 0 1rem; color: var(--muted); }
.prose ol li { margin-bottom: .6rem; }

/* Wide comparison tables. Scroll rather than crush on a phone — this article
   gets read on the device it is about. */
.prose .grid-table { display: block; overflow-x: auto; margin: 0 0 1.5rem; }
.prose .grid-table table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.prose .grid-table th {
  text-align: left; font-family: var(--mono); font-size: .72rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: .05em; color: var(--faint);
  padding: .5rem .7rem .5rem 0; border-bottom: 1px solid var(--hairline); white-space: nowrap;
}
.prose .grid-table td {
  padding: .6rem .7rem .6rem 0; border-bottom: 1px solid var(--hairline);
  color: var(--muted); vertical-align: top;
}

/* ponytail: no icons, no gradient, no rounded card — a rule and a tint. The
   icon-card look is the visual signature readers skim past. */
.prose .note {
  border-left: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, transparent);
  padding: .9rem 1.1rem; margin: 0 0 1.5rem;
}
.prose .note p:last-child, .prose .note ul:last-child { margin-bottom: 0; }
.prose .note strong { color: var(--ink); }

.byline { font-family: var(--mono); font-size: .75rem; color: var(--faint);
  margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--hairline); }
