/* Utility classes and the compact-viewport overrides built on them. Deliberately late in the cascade: these are the last-word helpers. */

/* Utilities */
.hidden {
  display: none !important;
}
.empty-state {
  text-align: center;
  color: var(--muted-foreground);
  padding: 2rem 1rem;
  font-size: 0.875rem;
}
.code-inline {
  font-family: var(--font-mono);
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.125rem 0.375rem;
  font-size: 0.75rem;
}
.steps-list {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  line-height: 1.6;
}
.steps-list a {
  color: var(--primary);
  word-break: break-all;
}
.help-block {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  margin-bottom: 1rem;
  line-height: 1.6;
  padding: 0.75rem 0.875rem;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.help-block:last-of-type {
  margin-bottom: 1.25rem;
}
.help-block b {
  color: var(--foreground);
  font-weight: 600;
}
.help-block p {
  margin: 0;
}
.help-block p + p {
  margin-top: 0.375rem;
}
.code-card {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.875rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 12.5rem;
  overflow-y: auto;
  line-height: 1.6;
}
.machine-id-row + .help-block {
  margin-top: 0.75rem;
}
.input-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.input-row > input,
.input-row > textarea {
  flex: 1;
  min-width: 8rem;
}
.form-group .input-row > label {
  display: inline-flex;
  margin: 0;
  cursor: pointer;
}
.success-emoji {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 0.75rem;
}

/* Compact responsive fixes */
@media (max-width: 720px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .modal-content {
    width: 90vw;
    max-width: 90vw;
    max-height: 90vh;
  }
  .api-endpoint-item {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0.75rem;
  }
  .api-code-row {
    align-items: flex-start;
    flex-direction: row;
    padding: 0.5rem 0.5rem 0.5rem 0.75rem;
    gap: 0.5rem;
  }
  .api-code {
    flex: 1;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-all;
    line-height: 1.55;
  }
  .api-copy-btn {
    width: 2rem;
    height: 2rem;
    justify-content: center;
    align-self: flex-start;
    flex: none;
  }
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .app-header {
    background: var(--background);
    border-bottom: 1px solid var(--border);
  }
  .app-header-inner {
    width: 100%;
    max-width: 28rem;
    box-sizing: border-box;
    height: auto;
    min-height: 0;
    padding: 0.875rem 1rem 0.95rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand actions"
      "nav nav";
    align-items: center;
    gap: 0.875rem 0.75rem;
  }
  .brand-wrap {
    grid-area: brand;
    min-width: 0;
  }
  .brand {
    min-height: 2.25rem;
    max-width: 100%;
    min-width: 0;
    gap: 0.625rem;
  }
  img.brand-icon {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: var(--radius-md);
  }
  .brand-text {
    font-size: 0.9375rem;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .header-nav {
    grid-area: nav;
    width: 100%;
    margin-left: 0;
    justify-content: center;
    overflow: visible;
  }
  .tabs {
    width: min(100%, 23rem);
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .tab {
    min-height: 2.75rem;
    height: auto;
    padding: 0.375rem 0.25rem;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 650;
    line-height: 1;
    background: transparent;
  }
  .tab-icon {
    display: inline-flex;
    font-size: 0.875rem;
    line-height: 1;
    opacity: 0.72;
  }
  .tab.active {
    color: var(--foreground);
    background: transparent;
  }
  .tab.active .tab-icon {
    opacity: 1;
  }
  .app-header-inner .topbar-actions {
    grid-area: actions;
    margin-left: 0;
    justify-content: flex-end;
    gap: 0.35rem;
    flex-wrap: nowrap;
  }
  #mainLangSwitch {
    height: 2.25rem;
  }
  #mainLangSwitch .lang-btn {
    min-width: 2.125rem;
    padding: 0 0.5rem;
  }
  #mainThemeToggle {
    width: 2.25rem;
    height: 2.25rem;
  }
  #logoutBtn {
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
  }
  #logoutBtn span {
    display: none;
  }
  .app-header-inner .divider {
    display: none;
  }
}

