@font-face {
  font-family: 'Hanken Grotesk';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("https://as44354.net/static/font/hankengrotesk.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("https://as44354.net/static/font/jetbrainsmono.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --background: 0 0% 6%;
  --foreground: 0 0% 100%;
  --muted: 0 0% 10%;
  --muted-foreground: 0 0% 66.7%;
  --popover: 0 0% 9%;
  --popover-foreground: 0 0% 93.3%;
  --card: 0 0% 9%;
  --card-foreground: 0 0% 100%;
  --terminal: 0 0% 4%;
  --border: 0 0% 18%;
  --input: 0 0% 22%;
  --primary: 255 78% 55%;
  --primary-foreground: 0 0% 100%;
  --secondary: 255 78% 50%;
  --secondary-foreground: 0 0% 100%;
  --accent: 0 0% 10%;
  --accent-foreground: 0 0% 100%;
  --destructive: 0 63% 31%;
  --destructive-foreground: 0 0% 100%;
  --ring: 0 0% 53.3%;
  --ring-offset: 0 0% 6%;
  --radius: 0.5rem;
}

* {
  box-sizing: border-box;
  border-color: hsl(var(--border));
}

body {
  margin: 0;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color-scheme: dark;
  font-feature-settings: "rlig" 1, "calt" 1;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 1536px) {
  .container {
    padding-left: 0;
    padding-right: 0;
  }
}

.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 2rem 0;
  width: 100%;
}

@media (min-width: 768px) {
  .header {
    flex-direction: row;
    justify-content: space-between;
  }
}

.header-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
}

.logo-wrap {
  height: 2rem;
  width: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo {
  display: block;
  max-height: 100%;
  max-width: 100%;
  height: auto;
  width: auto;
  object-fit: contain;
}

.header-divider {
  display: none;
  width: 1px;
  min-height: 30px;
  background-color: hsl(0 0% 70%);
}

.header-title {
  display: none;
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 600;
}

@media (min-width: 640px) {
  .header-divider,
  .header-title {
    display: block;
  }
}

.location-select-wrap,
.command-select-wrap {
  width: 100%;
  position: relative;
}

@media (min-width: 768px) {
  .location-select-wrap {
    width: 180px;
    flex-shrink: 0;
  }
  .command-select-wrap {
    width: auto;
    min-width: 180px;
    flex-shrink: 0;
  }
}

.card {
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border-radius: var(--radius);
  box-shadow: 0 1px 2px hsl(0 0% 0% / 0.35);
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .meta-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .meta-cell:not(:last-child) {
    border-right: 1px solid hsl(var(--border));
  }
}

.meta-cell {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
}

.meta-label {
  font-size: 0.75rem;
  line-height: 1rem;
  color: hsl(var(--muted-foreground));
}

.meta-cell code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8125rem;
  letter-spacing: -0.01em;
}

.form-card {
  padding: 0.75rem;
}

.results-card {
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.results-card--loading .results-terminal {
  border-color: hsl(var(--primary) / 0.35);
}

.results-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.results-status {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
}

.results-run {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
}

.results-run b {
  font-weight: 500;
  color: hsl(var(--foreground));
}

.results-run i {
  font-style: normal;
  color: hsl(var(--muted-foreground));
}

.results-run code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: hsl(var(--foreground));
}

.results-run span {
  color: hsl(var(--muted-foreground));
}

.results-status.is-loading::before {
  content: '';
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid hsl(var(--border));
  border-top-color: hsl(var(--primary));
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.section-title {
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 400;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .form-row {
    flex-direction: row;
    align-items: stretch;
  }
}

/* Input — matches shadcn focus-visible:ring-ring (gray), not primary */
.input {
  display: flex;
  height: 2.5rem;
  width: 100%;
  flex: 1;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--input));
  background-color: transparent;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: hsl(var(--foreground));
  font-family: inherit;
  transition: box-shadow 0.15s ease;
}

.input::placeholder {
  color: hsl(var(--muted-foreground));
}

.input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--ring-offset)), 0 0 0 4px hsl(var(--ring));
}

.input:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Custom select */
.custom-select {
  position: relative;
  width: 100%;
}

.select-trigger {
  display: flex;
  height: 2.5rem;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--input));
  background-color: transparent;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: hsl(var(--foreground));
  font-family: inherit;
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}

.select-trigger:hover:not(:disabled) {
  background-color: hsl(var(--accent) / 0.3);
}

.select-trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--ring-offset)), 0 0 0 4px hsl(var(--ring));
}

.select-trigger:disabled,
.custom-select.disabled .select-trigger {
  cursor: not-allowed;
  opacity: 0.5;
}

.select-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.select-chevron {
  flex-shrink: 0;
  opacity: 0.5;
  margin-left: 0.5rem;
  transition: transform 0.15s ease;
}

.custom-select.open .select-chevron {
  transform: rotate(180deg);
}

.select-content {
  display: none;
  position: absolute;
  z-index: 50;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 8rem;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--popover));
  color: hsl(var(--popover-foreground));
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.35), 0 2px 4px -2px rgb(0 0 0 / 0.35);
  padding: 0.25rem;
  max-height: 280px;
  overflow-y: auto;
  transform-origin: top center;
}

.select-content.open {
  display: block;
  animation: select-in 0.15s ease-out;
}

@keyframes select-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-2px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.select-label {
  padding: 0.375rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.select-item {
  position: relative;
  display: flex;
  width: 100%;
  cursor: default;
  user-select: none;
  align-items: center;
  border-radius: calc(var(--radius) - 2px);
  padding: 0.375rem 0.5rem 0.375rem 2rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  outline: none;
}

.select-item:hover,
.select-item:focus {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.select-item.selected {
  background-color: hsl(var(--accent) / 0.6);
}

.select-item-indicator {
  position: absolute;
  left: 0.5rem;
  display: flex;
  height: 0.875rem;
  width: 0.875rem;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

.select-item.selected .select-item-indicator {
  opacity: 1;
}

.select-check {
  width: 1rem;
  height: 1rem;
}

.select-item-text {
  flex: 1;
}

/* Button */
.btn {
  display: inline-flex;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: none;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.btn:hover:not(:disabled) {
  background-color: hsl(var(--primary) / 0.9);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--ring-offset)), 0 0 0 4px hsl(var(--primary) / 0.55);
}

.btn:disabled {
  pointer-events: none;
  opacity: 0.5;
}

/* Alert */
.alert {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  padding: 1rem;
  background-color: hsl(var(--background));
}

.alert-destructive {
  border-color: hsl(var(--destructive) / 0.5);
  color: hsl(var(--destructive));
}

.alert-destructive .alert-title {
  color: hsl(var(--destructive));
}

.alert-title {
  margin-bottom: 0.25rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.025em;
}

.alert-desc {
  font-size: 0.875rem;
  line-height: 1.625;
}

.alert-destructive .alert-desc {
  color: hsl(var(--destructive) / 0.9);
}

.results-terminal {
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  background-color: hsl(var(--terminal));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: auto;
  max-height: 32rem;
  transition: border-color 0.2s ease;
}

.term {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.875rem;
}

.hidden {
  display: none !important;
}
