/* Appwrite status page, in the console's design language (appwrite/vibes
   src/styles.css and AGENTS.md): Inter, 13-15px type, rounded-xl bordered
   cards with separators, tinted status badges, pink primary actions. Dark by
   default like the console; light when the system asks for it. */

@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Aeonik Pro'; font-weight: 400; font-display: swap; src: url('fonts/AeonikPro-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 500 600; font-display: swap; src: url('fonts/inter-latin-600-normal.woff2') format('woff2'); }

:root {
  color-scheme: dark;
  --background: #19191c;
  --card: #1d1d21;
  --surface: #1b1b1e; /* vibes' bg-card/50 over the background */
  --muted: #2d2d31;
  --border: oklch(0.252 0.005 286.32);
  --foreground: oklch(0.985 0 0);
  --muted-foreground: oklch(0.705 0.015 286.067);
  --primary: #fd366e;
  --primary-hover: #e32e62;

  --green: oklch(0.792 0.209 151.711);   /* green-400 */
  --green-bar: oklch(0.723 0.219 149.579 / 0.85);
  --amber: oklch(0.828 0.189 84.429);    /* amber-400 */
  --red: oklch(0.704 0.191 22.216);      /* red-400 */
  --blue: oklch(0.707 0.165 254.624);    /* blue-400 */
  --empty: #2d2d31;

  --radius: 0.625rem;
  --font: 'Inter', system-ui, -apple-system, sans-serif;

  /* vibes buildInitGlobeConfig (dark) */
  --globe-ocean: #3b3a43;
  --globe-ocean-edge: #242329;
  --globe-land: #b8b8c0;
  --globe-glow: rgb(253 54 110 / 0.16);
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --background: oklch(0.985 0 0);
    --card: oklch(1 0 0);
    --surface: #ffffff;
    --muted: oklch(0.967 0.001 286.375);
    --border: oklch(0.93 0.0035 286.32);
    --foreground: oklch(0.141 0.005 285.823);
    --muted-foreground: oklch(0.552 0.016 285.938);
    --green: oklch(0.627 0.194 149.214);  /* green-600 */
    --green-bar: oklch(0.723 0.219 149.579);
    --amber: oklch(0.666 0.179 58.318);   /* amber-600 */
    --red: oklch(0.577 0.245 27.325);     /* red-600 */
    --blue: oklch(0.546 0.245 262.881);   /* blue-600 */
    --empty: oklch(0.92 0.004 286.32);
    --globe-ocean: #ffffff;
    --globe-ocean-edge: #eeeef1;
    --globe-land: #8b8b96;
    --globe-glow: rgb(253 54 110 / 0.12);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh;
  background: var(--background); color: var(--foreground);
  font: 400 13px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted-foreground); }

.icon {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* Top bar */
.topbar { border-bottom: 1px solid var(--border); background: var(--background); position: sticky; top: 0; z-index: 10; }
/* Brand, tabs and action in three columns, so the tabs sit in the true centre. */
.topbar-inner {
  max-width: 832px; margin: 0 auto; padding: 0 16px; height: 64px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
}
.topbar-inner > .button { justify-self: end; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 15px; font-weight: 600; }
.topbar nav { display: flex; gap: 4px; }
.topbar nav a {
  text-decoration: none; color: var(--muted-foreground); font-weight: 500;
  padding: 6px 10px; border-radius: 8px; transition: color 0.2s, background 0.2s;
}
.topbar nav a:hover { color: var(--foreground); background: var(--muted); }
.topbar nav a[aria-current="page"] { color: var(--foreground); background: var(--muted); }

.button {
  height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--muted); color: var(--foreground); font: 600 13px var(--font); cursor: pointer;
  transition: background 0.2s;
}
.button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.button.primary:hover { background: var(--primary-hover); }
.icon-button {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none;
  border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--muted-foreground); cursor: pointer;
}
.icon-button:hover { color: var(--foreground); background: var(--muted); }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; }
.link:hover { text-decoration: underline; }

.stale {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: color-mix(in srgb, var(--amber) 12%, var(--background)); color: var(--amber);
  padding: 10px 16px; font-weight: 500;
}

main { max-width: 832px; margin: 0 auto; padding: 32px 16px 48px; display: flex; flex-direction: column; gap: 12px; }

/* Cards: the console's settings card (rounded-xl border bg-card/50). */
.card { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 15px; font-weight: 600; }

.group {
  margin-top: 20px; padding: 0 4px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted-foreground);
}

/* Overview hero, after the network section on appwrite.io */
.hero {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding-top: 24px; margin: 0 -16px; overflow: hidden;
}
.hero-copy { display: flex; flex-direction: column; align-items: center; gap: 16px; max-width: 640px; padding: 0 16px; position: relative; z-index: 1; }
.hero-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 5px 10px; border-radius: 999px; }
.hero-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tone); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 25%, transparent); }
.hero h1 {
  font-family: 'Aeonik Pro', var(--font); font-weight: 400; font-size: clamp(32px, 6vw, 44px);
  line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance;
}
.cursor { color: var(--primary); margin-left: 0.08em; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero-copy > p { font-size: 15px; line-height: 1.6; color: var(--muted-foreground); max-width: 540px; }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; }
.facts li { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.facts .icon { color: var(--tone); }
.globe { display: block; width: 100%; height: 380px; margin-top: 8px; cursor: grab; touch-action: pan-y; }
.globe:active { cursor: grabbing; }
.hero::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 160px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--background));
}
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

.notice {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px;
  color: var(--amber); background: color-mix(in srgb, var(--amber) 8%, var(--background));
  border: 1px solid color-mix(in srgb, var(--amber) 24%, var(--border));
}
.notice .icon { margin-top: 2px; }

/* Components and their 90-day bars */
.components { list-style: none; margin: 0; padding: 0; }
.component { padding: 14px 24px; }
.component + .component { border-top: 1px solid var(--border); }
.component-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.component-head .name { font-weight: 500; margin-right: auto; }
.uptime { font-size: 12px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.bars { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; height: 24px; }
.bars li { flex: 1; border-radius: 2px; background: var(--bar); transition: opacity 0.15s; }
.bars li:hover, .bars li:focus-visible { opacity: 0.65; outline: none; }

.tooltip {
  position: fixed; z-index: 20; pointer-events: none; min-width: 180px; max-width: 260px;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); color: var(--foreground); box-shadow: 0 12px 32px rgb(0 0 0 / 0.35);
  display: flex; flex-direction: column; gap: 2px; font-size: 12px;
}
.tooltip-date { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.tooltip-status { display: flex; align-items: center; gap: 6px; font-weight: 500; color: var(--tone); }
.tooltip-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bar); }
.tooltip-detail { color: var(--muted-foreground); }
.tooltip-incident { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); font-weight: 500; }
.tooltip-incident + .tooltip-incident { margin-top: 0; padding-top: 2px; border-top: 0; }
.scale { display: flex; justify-content: space-between; padding: 0 24px 14px; font-size: 11px; color: var(--muted-foreground); }

.regions .region + .region { border-top: 1px solid var(--border); }
.region > summary { display: flex; align-items: center; gap: 12px; padding: 14px 24px; cursor: pointer; list-style: none; }
.region > summary::-webkit-details-marker { display: none; }
.region > summary:hover { background: color-mix(in srgb, var(--muted) 40%, transparent); }
.flag {
  width: 24px; height: 24px; flex: none; object-fit: cover;
  border-radius: 8px; border: 1px solid color-mix(in srgb, var(--border) 50%, transparent); background: var(--background);
}
.region-label { display: flex; flex-direction: column; margin-right: auto; min-width: 0; }
.region-name { font-weight: 500; }
.region-sub { font-size: 12px; color: var(--muted-foreground); }
.bars.mini { width: 180px; height: 18px; gap: 2px; flex: none; }
.bars.mini li { border-radius: 1.5px; }
.region .uptime { width: 56px; text-align: right; }
.chevron { display: grid; color: var(--muted-foreground); transition: transform 0.2s; }
.region[open] .chevron { transform: rotate(90deg); }
.region[open] > summary { border-bottom: 1px solid var(--border); }

/* Badges: vibes' status variants (tinted background, coloured text, subtle border). */
.badge {
  flex: none; font-size: 11px; font-weight: 500; line-height: 1; padding: 4px 8px; border-radius: 6px;
  color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--tone) 22%, transparent);
}

.state-operational { --tone: var(--green); --bar: var(--green-bar); }
.state-degraded { --tone: var(--amber); --bar: var(--amber); }
.state-downtime { --tone: var(--red); --bar: var(--red); }
.state-maintenance, .state-scheduled { --tone: var(--blue); --bar: var(--blue); }
.state-not_monitored { --tone: var(--muted-foreground); --bar: var(--empty); }
.state-resolved { --tone: var(--green); --bar: var(--empty); }

/* Incidents: one card each, a timeline of updates inside. */
.incident { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.incident-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.incident h3 { font-size: 15px; font-weight: 600; }
.meta { color: var(--muted-foreground); font-size: 12px; margin-top: 3px; }
.meta .sep { margin: 0 6px; }

.affected { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.affected li {
  display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 6px 0 10px;
  border: 1px solid var(--border); border-radius: 999px; font-size: 12px; font-weight: 500;
}
.affected li:not(:has(.flags, .all-regions)) { padding-right: 10px; }
.flags { display: inline-flex; }
.flags img {
  width: 16px; height: 16px; border-radius: 50%; object-fit: cover;
  box-shadow: 0 0 0 2px var(--surface);
}
.flags img + img { margin-left: -4px; }
.all-regions { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--muted); color: var(--muted-foreground); }

.updates { list-style: none; margin: 0; padding: 0; }
.update { display: flex; gap: 12px; position: relative; padding-bottom: 14px; }
.update:last-child { padding-bottom: 0; }
/* The line joining one update's dot to the next. */
.update:not(:last-child)::after {
  content: ''; position: absolute; left: 7px; top: 20px; bottom: 2px; width: 2px; background: var(--border);
}
.update-dot {
  flex: none; width: 16px; height: 16px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--tone) 18%, transparent); box-shadow: inset 0 0 0 1.5px var(--tone); color: var(--tone);
}
.update-dot .icon { width: 10px; height: 10px; stroke-width: 3; }
.update-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.update-head { display: flex; align-items: baseline; gap: 8px; }
.update-status { font-weight: 600; color: var(--tone); }
.update-head time { font-size: 12px; color: var(--muted-foreground); }
.update-body p { color: color-mix(in srgb, var(--foreground) 85%, transparent); overflow-wrap: anywhere; }
.update-body a { color: var(--foreground); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.update-body a:hover { text-decoration-color: var(--primary); }
.update-body code {
  font: 12px ui-monospace, 'Fira Code', monospace; padding: 1px 5px; border-radius: 5px;
  background: var(--muted); border: 1px solid var(--border);
}

.earlier > summary {
  display: inline-flex; align-items: center; gap: 4px; cursor: pointer; list-style: none;
  color: var(--muted-foreground); font-size: 12px; font-weight: 500;
}
.earlier > summary::-webkit-details-marker { display: none; }
.earlier > summary .icon { width: 14px; height: 14px; transition: transform 0.2s; }
.earlier[open] > summary .icon { transform: rotate(90deg); }
.earlier > summary:hover { color: var(--foreground); }
.earlier[open] > summary { margin-bottom: 12px; }

.more { display: flex; align-items: center; gap: 6px; width: fit-content; margin: 8px 4px 0; color: var(--muted-foreground); text-decoration: none; font-weight: 500; }
.more:hover { color: var(--foreground); }

/* Incident and maintenance history: month labels over plain cards. */
.page-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.page-head h1 { font-size: 22px; font-weight: 600; }
.page-head p { color: var(--muted-foreground); }
.month { display: flex; flex-direction: column; gap: 12px; }
.empty {
  display: flex; align-items: center; gap: 8px; padding: 14px 20px; color: var(--muted-foreground);
  border: 1px dashed var(--border); border-radius: 12px;
}

/* Get updates dialog */
dialog {
  width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: 12px;
  background: var(--card); color: var(--foreground); box-shadow: 0 24px 64px rgb(0 0 0 / 0.4);
}
dialog::backdrop { background: rgb(0 0 0 / 0.6); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.dialog-head h2 { font-size: 15px; font-weight: 600; }
.dialog-head p { margin-top: 4px; }
.tabs { display: flex; margin: 16px 24px 0; padding: 3px; gap: 2px; border: 1px solid var(--border); border-radius: 8px; width: fit-content; }
.tabs button {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: none; color: var(--muted-foreground); font: 500 13px var(--font);
  padding: 5px 12px; border-radius: 6px; cursor: pointer;
}
.tabs .icon { width: 14px; height: 14px; }
.tabs button:not([aria-selected="true"]) .icon { opacity: 0.8; }
.tabs button[aria-selected="true"] { background: var(--muted); color: var(--foreground); }
.tab-panel { padding: 16px 24px 24px; display: flex; flex-direction: column; gap: 12px; color: var(--muted-foreground); }
.copy-field { display: flex; gap: 8px; }
.copy-field input {
  flex: 1; min-width: 0; height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--background); color: var(--foreground); font: 400 12px ui-monospace, 'Fira Code', monospace;
}
.copy-field .icon-button { width: 36px; height: 36px; }
[data-copy] .icon:last-child, [data-copy].copied .icon:first-child { display: none; }
[data-copy].copied .icon:last-child { display: block; color: var(--green); }

footer { max-width: 832px; margin: 0 auto; padding: 8px 16px 40px; display: flex; gap: 20px; justify-content: center; font-size: 12px; color: var(--muted-foreground); }
footer a { text-decoration: none; }
footer a:hover { color: var(--foreground); }

@media (max-width: 640px) {
  .topbar-inner { gap: 8px; }
  .topbar nav a:first-child, .brand span { display: none; }
  .globe { height: 260px; }
  .bars:not(.mini) li:nth-child(-n+60) { display: none; }
  .bars.mini, .region .uptime { display: none; }
  .scale span:first-child { visibility: hidden; }
  .component, .region > summary, .card-head, .incident { padding-left: 16px; padding-right: 16px; }
  .scale { padding: 0 16px 14px; }
}
