:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-strong: #ffffff;
  --line: rgba(0, 0, 0, 0.12);
  --accent: #0071e3;
  --accent-soft: rgba(0, 113, 227, 0.12);
  --green: #248a3d;
  --red: #d70015;
  --amber: #b26a00;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #000000;
    --ink: #f5f5f7;
    --muted: #a1a1a6;
    --panel: rgba(28, 28, 30, 0.72);
    --panel-strong: #1c1c1e;
    --line: rgba(255, 255, 255, 0.14);
    --accent: #0a84ff;
    --accent-soft: rgba(10, 132, 255, 0.16);
    --green: #30d158;
    --red: #ff453a;
    --amber: #ffd60a;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.login-shell,
.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-panel {
  width: min(420px, 100%);
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.04;
}

.muted {
  margin: 10px 0 0;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 26px;
}

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
}

input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
}

button {
  min-height: 44px;
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
}

.ghost {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
}

.error {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(215, 0, 21, 0.12);
  color: var(--red);
}

.app-shell {
  padding: 34px 0;
}

.app-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.google-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 22px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.google-search input {
  min-height: 48px;
  border-color: transparent;
  background: transparent;
  font-size: 17px;
}

.google-search input:focus {
  outline: 2px solid var(--accent-soft);
  outline-offset: 1px;
}

.google-search button {
  min-width: 92px;
  background: var(--accent);
  color: white;
}

.mode-switch {
  display: flex;
  min-height: 44px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.mode-switch button {
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.mode-switch button.active {
  background: var(--panel-strong);
  color: var(--ink);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  align-items: start;
  gap: 14px;
}

.service-card {
  position: relative;
  height: 132px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(22px);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.service-card.open {
  z-index: 30;
}

.service-card:not(.disabled):hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  box-shadow: var(--shadow);
}

.service-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 8px;
}

.service-card-content {
  position: relative;
  z-index: 2;
  display: grid;
  height: 100%;
  padding: 16px;
  pointer-events: none;
}

.service-card.disabled {
  opacity: 0.68;
}

.service-summary {
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 12px;
  padding-right: 54px;
}

.service-icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--panel-strong), var(--accent-soft));
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  border: 1px solid var(--line);
}

.service-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
}

.status-dot {
  position: absolute;
  top: 24px;
  right: 54px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(178, 106, 0, 0.12);
}

.status-dot.pending {
  background: var(--amber);
}

.status-dot.up {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(36, 138, 61, 0.12);
}

.status-dot.down {
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(215, 0, 21, 0.12);
}

.icon-action {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.icon-action[aria-expanded="true"] {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.quick-actions {
  align-self: end;
  display: inline-grid;
  justify-self: start;
  pointer-events: auto;
  z-index: 3;
}

.quick-action {
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.quick-action:disabled {
  cursor: wait;
  opacity: 0.7;
}

.service-details {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  width: min(320px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  pointer-events: auto;
}

.service-details[hidden] {
  display: none;
}

.service-details h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

.service-details dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.service-details div {
  display: grid;
  gap: 3px;
}

.service-details dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.service-details dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.service-details p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 640px) {
  .app-header {
    display: grid;
  }

  .header-actions {
    display: grid;
    align-items: stretch;
  }

  .google-search {
    grid-template-columns: 1fr;
  }

  .service-grid {
    grid-template-columns: 1fr;
  }
}
