:root {
  --gm-text: #1a1a1a;
  --gm-muted: #6b7280;
  --gm-border: #e5e7eb;
  --gm-bg: #fafafa;
  --gm-surface: #fff;
  --gm-accent: #2563eb;
  --gm-accent-soft: #eff6ff;
  --gm-code-bg: #f3f4f6;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--gm-text);
  background: var(--gm-bg);
  -webkit-font-smoothing: antialiased;
}

.gm-navbar {
  background: var(--gm-surface);
  border-bottom: 1px solid var(--gm-border);
}

.gm-navbar .navbar-brand {
  font-weight: 700;
  color: var(--gm-text);
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.gm-navbar .nav-link {
  color: var(--gm-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.gm-navbar .nav-link:hover,
.gm-navbar .nav-link.active {
  color: var(--gm-text);
}

.gm-navbar .nav-link.gm-user {
  color: var(--gm-muted);
  font-weight: 400;
}

.gm-dropdown {
  font-size: 0.875rem;
  border-color: var(--gm-border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.gm-dropdown .dropdown-item {
  font-size: 0.8125rem;
  padding: 0.375rem 0.875rem;
  color: var(--gm-text);
}

.gm-dropdown .dropdown-item:hover,
.gm-dropdown .dropdown-item:focus {
  background: var(--gm-bg);
  color: var(--gm-text);
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

.page-header .meta {
  color: var(--gm-muted);
  font-size: 0.8125rem;
  margin-top: 0.125rem;
}

.gm-card {
  background: var(--gm-surface);
  border: 1px solid var(--gm-border);
  border-radius: 0.5rem;
}

.gm-card-body {
  padding: 1rem 1.25rem;
}

.gm-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gm-text);
  text-decoration: none;
}

.gm-card-title:hover {
  color: var(--gm-accent);
}

.gm-card-meta {
  font-size: 0.8125rem;
  color: var(--gm-muted);
}

.gm-table {
  font-size: 0.875rem;
}

.gm-table thead th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gm-muted);
  border-bottom-width: 1px;
  padding: 0.625rem 0.75rem;
}

.gm-table tbody td {
  padding: 0.625rem 0.75rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--gm-border);
}

.gm-table tbody tr:last-child td {
  border-bottom: none;
}

.gm-table code {
  background: var(--gm-code-bg);
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.8125rem;
  color: var(--gm-text);
  font-weight: 500;
}

.gm-table .url-cell {
  color: var(--gm-muted);
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-gm {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
}

.btn-gm-primary,
.nav-link.btn-gm-primary {
  background: var(--gm-text);
  color: #fff;
  border: 1px solid var(--gm-text);
}

.btn-gm-primary:hover {
  background: #333;
  color: #fff;
  border-color: #333;
}

.btn-gm-secondary {
  background: var(--gm-surface);
  color: var(--gm-text);
  border: 1px solid var(--gm-border);
}

.btn-gm-secondary:hover {
  background: var(--gm-bg);
  border-color: #d1d5db;
}

.btn-gm-ghost {
  background: none;
  color: var(--gm-muted);
  border: none;
  padding: 0.25rem 0.5rem;
}

.btn-gm-ghost:hover {
  color: var(--gm-text);
  background: var(--gm-code-bg);
}

.btn-gm-sm {
  font-size: 0.8125rem;
  padding: 0.25rem 0.5rem;
}

.btn-gm[disabled],
.btn-gm.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.gm-badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  border-radius: 1rem;
  background: var(--gm-code-bg);
  color: var(--gm-muted);
}

.gm-badge-accent {
  background: var(--gm-accent-soft);
  color: var(--gm-accent);
}

.gm-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gm-muted);
  margin-bottom: 0.75rem;
}

.gm-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gm-muted);
  font-size: 0.875rem;
}

.gm-sep {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gm-muted);
  vertical-align: middle;
  margin: 0 0.5rem;
}

.gm-toolbar {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.gm-hero {
  padding: 4rem 0 3rem;
}

.gm-hero h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.gm-hero .lead {
  font-size: 1.0625rem;
  color: var(--gm-muted);
  line-height: 1.6;
  max-width: 32rem;
}

.gm-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--gm-text);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.gm-step-title {
  font-weight: 600;
  font-size: 0.875rem;
}

.gm-step-desc {
  font-size: 0.8125rem;
  color: var(--gm-muted);
  line-height: 1.5;
}

.gm-input-search .form-control {
  border: 1px solid var(--gm-border);
  border-radius: 0.5rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
}

.gm-input-search .form-control:focus {
  border-color: var(--gm-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.gm-card-list .gm-card + .gm-card {
  border-top: none;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.gm-card-list .gm-card:not(:last-child) {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.gm-card-list .gm-card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gm-install-card {
  border-left: 3px solid var(--gm-text);
}

.gm-form .form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.gm-form .form-text {
  font-size: 0.8125rem;
}

.gm-form .form-control,
.gm-form .form-select {
  font-size: 0.875rem;
  border-color: var(--gm-border);
  border-radius: 0.375rem;
}

.gm-form .form-control:focus,
.gm-form .form-select:focus {
  border-color: var(--gm-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.gm-composed-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
}

.gm-text-sm {
  font-size: 0.8125rem;
}

.gm-text-muted {
  color: var(--gm-muted);
}

.gm-card-body-lg {
  padding: 1.25rem;
}

.gm-card-heading {
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.gm-card-desc {
  font-size: 0.8125rem;
  color: var(--gm-muted);
  margin-bottom: 0.75rem;
}

.gm-pre {
  background: var(--gm-code-bg);
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
}

.gm-input-mono {
  font-size: 0.8125rem;
}

.gm-input-prefix {
  width: 150px;
}

.gm-btn-danger {
  background: #dc3545;
  color: #fff;
  border: 1px solid #dc3545;
}

.gm-btn-danger:hover {
  background: #bb2d3b;
  color: #fff;
  border-color: #bb2d3b;
}

.gm-danger-text {
  color: #dc3545;
}

.btn-gm-ghost.gm-danger-text:hover {
  background: rgba(220, 53, 69, 0.06);
}

.gm-alert {
  font-size: 0.875rem;
  border-radius: 0.5rem;
}

.gm-footer {
  border-top: 1px solid var(--gm-border);
  padding: 2rem 0;
  margin-top: 3rem;
  font-size: 0.8125rem;
  color: var(--gm-muted);
}

.gm-footer a {
  color: var(--gm-muted);
  text-decoration: none;
}

.gm-footer a:hover {
  color: var(--gm-text);
}

.page-section + .page-section {
  margin-top: 2rem;
}

main.container {
  max-width: 56rem;
}

/* Omnibox demo */
.demo-heading {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--gm-text);
  margin-bottom: 1rem;
}

.demo-heading-sub {
  font-weight: 400;
  color: var(--gm-muted);
}

.browser {
  background: var(--gm-surface);
  border: 1px solid var(--gm-border);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}

.browser-toolbar {
  background: #f0f1f3;
  padding: 0.625rem 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  border-bottom: 1px solid var(--gm-border);
}

.browser-dots {
  display: flex;
  gap: 0.375rem;
  flex-shrink: 0;
}

.browser-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d1d5db;
}

.browser-nav {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
  color: #9ca3af;
}

.browser-nav span {
  font-size: 1rem;
  width: 1.5rem;
  text-align: center;
  line-height: 1.5rem;
}

.omnibox {
  flex: 1;
  background: var(--gm-surface);
  border: 1px solid var(--gm-border);
  border-radius: 1rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 2rem;
  position: relative;
  overflow: hidden;
}

.omnibox-chip {
  background: #e8eaed;
  border-radius: 0.25rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gm-text);
  white-space: nowrap;
  flex-shrink: 0;
  display: none;
}

.omnibox-chip.visible {
  display: inline-block;
}

.omnibox-text {
  color: var(--gm-text);
  white-space: nowrap;
  position: relative;
}

.omnibox-cursor {
  display: inline-block;
  width: 1px;
  height: 1em;
  background: var(--gm-text);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.omnibox-suggestion {
  color: #9ca3af;
  white-space: nowrap;
}

.omnibox-dropdown {
  position: absolute;
  top: 100%;
  left: -1px;
  right: -1px;
  background: var(--gm-surface);
  border: 1px solid var(--gm-border);
  border-top: none;
  border-radius: 0 0 0.75rem 0.75rem;
  padding: 0.25rem 0;
  display: none;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.omnibox-dropdown.visible {
  display: block;
}

.omnibox-dropdown-item {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.omnibox-dropdown-item.highlighted {
  background: var(--gm-accent-soft);
}

.dropdown-icon {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  border-radius: 0.125rem;
  background: #e8eaed;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  color: var(--gm-muted);
}

.dropdown-label {
  color: var(--gm-muted);
  font-size: 0.75rem;
}

.dropdown-tab-hint {
  margin-left: auto;
  font-size: 0.6875rem;
  color: var(--gm-accent);
  background: var(--gm-accent-soft);
  padding: 0.0625rem 0.375rem;
  border-radius: 0.25rem;
  font-weight: 500;
}

.browser-content {
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
}

.page-blank {
  color: #d1d5db;
  font-size: 0.8125rem;
}

.page-result {
  display: none;
  text-align: center;
  width: 100%;
}

.page-result.visible {
  display: block;
}

.page-result-url {
  font-size: 0.75rem;
  color: var(--gm-muted);
  margin-bottom: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

.page-result-heading {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gm-text);
  letter-spacing: -0.02em;
}

.page-result-meta {
  font-size: 0.8125rem;
  color: var(--gm-muted);
  margin-top: 0.25rem;
}

.loading-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 2px;
  background: var(--gm-accent);
  width: 0;
  transition: none;
}

.loading-bar.loading {
  animation: load 0.4s ease-out forwards;
}

@keyframes load {
  0% { width: 0; }
  60% { width: 80%; }
  100% { width: 100%; }
}

.demo-caption {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--gm-muted);
  min-height: 1.25rem;
  transition: opacity 0.15s;
}

.replay-btn {
  display: none;
  margin: 1rem auto 0;
  background: none;
  border: 1px solid var(--gm-border);
  border-radius: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gm-muted);
  cursor: pointer;
  font-family: inherit;
}

.replay-btn:hover {
  color: var(--gm-text);
  border-color: #d1d5db;
}

.replay-btn.visible {
  display: block;
}

.shortcut-def-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}

.shortcut-def-wrap.visible {
  grid-template-rows: 1fr;
}

.shortcut-def-inner {
  overflow: hidden;
}

.shortcut-def {
  margin-top: 0.75rem;
  background: var(--gm-surface);
  border: 1px solid var(--gm-border);
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  overflow: hidden;
}

.shortcut-def-wrap.visible .shortcut-def {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.05s;
}

.shortcut-def-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--gm-border);
}

.shortcut-def-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gm-text);
}

.shortcut-def-badge {
  font-size: 0.6875rem;
  color: var(--gm-muted);
}

.shortcut-def table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.shortcut-def th {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gm-muted);
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--gm-border);
  text-align: left;
}

.shortcut-def td {
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--gm-border);
  vertical-align: middle;
}

.shortcut-def tr:last-child td {
  border-bottom: none;
}

.shortcut-def tr.def-dimmed td {
  color: #c9cdd3;
}

.shortcut-def tr.def-dimmed code {
  color: #c9cdd3;
  background: #f7f7f8;
}

.shortcut-def tr.def-highlight td {
  background: var(--gm-accent-soft);
}

.shortcut-def code {
  background: var(--gm-code-bg);
  padding: 0.1rem 0.35rem;
  border-radius: 0.2rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gm-text);
}

.shortcut-def .url-cell {
  color: var(--gm-muted);
  font-size: 0.75rem;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 767.98px) {
  .page-header .d-flex {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start !important;
  }
  .gm-toolbar {
    width: 100%;
  }
  .gm-toolbar .btn-gm {
    flex: 1;
    text-align: center;
  }
}
