:root {
  --bg: #f5f7fa;
  --bg-subtle: #eef3f8;
  --surface: #ffffff;
  --surface-soft: #fbfcfd;
  --surface-muted: #f7f9fb;
  --text: #1c2733;
  --muted: #566370;
  --line: #d9e2ea;
  --line-strong: #c8d3dd;
  --brand: #c74634;
  --brand-strong: #a82f21;
  --brand-soft: rgba(199, 70, 52, 0.12);
  --brand-softer: rgba(199, 70, 52, 0.06);
  --focus: #2f6ee5;
  --success: #2f7d32;
  --success-soft: rgba(47, 125, 50, 0.12);
  --warning: #a76900;
  --warning-soft: rgba(167, 105, 0, 0.14);
  --danger: #b22822;
  --danger-soft: rgba(178, 40, 34, 0.12);
  --info: #1467c4;
  --info-soft: rgba(20, 103, 196, 0.12);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 22px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08), 0 20px 44px rgba(15, 23, 42, 0.05);
  --radius-xl: 14px;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(180deg, #fbfcfd 0%, #f5f7fa 100%);
  font-family: "Oracle Sans", "OracleSans", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand) 0%, #ff7a45 100%);
  z-index: 50;
}

.ambient {
  display: none;
}

.app-header {
  position: sticky;
  top: 4px;
  z-index: 45;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.app-header-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.app-brand-copy {
  display: grid;
  gap: 0.1rem;
}

.app-brand-title {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.1;
}

.app-brand-subtitle {
  color: #6b7785;
  font-size: 0.82rem;
  line-height: 1.2;
}

.app-header-profile-slot {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.header-profile {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.header-profile-copy {
  display: grid;
  gap: 0.08rem;
  justify-items: end;
}

.header-profile-label {
  color: #6b7785;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.header-profile-name {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
}

.header-profile-action {
  min-height: 2.45rem;
  padding-inline: 0.95rem;
}

.page-shell {
  position: relative;
  max-width: 74rem;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 20rem);
  gap: 1rem;
  align-items: start;
  justify-content: center;
}

.panel {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  animation: rise-in 180ms ease both;
}

.hero > .panel-main:only-child {
  grid-column: 1 / -1;
  max-width: 56rem;
  width: 100%;
  margin-inline: auto;
  justify-self: center;
}

.panel-main {
  padding: 1.6rem;
}

.panel-side {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--surface-soft);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  margin-bottom: 0.9rem;
  padding: 0.25rem 0;
  border-radius: 0;
  background: transparent;
  color: #6b7785;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-intro {
  display: grid;
  gap: 0.75rem;
}

.section-block {
  margin-top: 1.35rem;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
  font-family: "Oracle Sans", "OracleSans", "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  line-height: 1.16;
}

h1 {
  font-size: clamp(2.35rem, 4vw, 3.8rem);
  max-width: 13ch;
}

h2 {
  font-size: clamp(1.65rem, 2.5vw, 2.35rem);
}

h3 {
  font-size: 1rem;
}

p {
  margin: 0;
  color: var(--muted);
}

.lede {
  max-width: 64ch;
  font-size: 1.05rem;
  line-height: 1.72;
}

.meta-grid,
.summary-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.meta-card,
.summary-card {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
}

.meta-label,
.summary-label {
  display: block;
  margin-bottom: 0.35rem;
  color: #6b7785;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.meta-value,
.summary-value {
  color: var(--text);
  font-weight: 600;
}

.auth-actions,
.wizard-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.button,
.button-secondary,
.button-link,
.tool-menu-button,
.tool-menu-item {
  font: inherit;
}

.button,
.button-secondary,
.button-link {
  appearance: none;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease, color 120ms ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 2.9rem;
  padding: 0.78rem 1.2rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #ffffff;
  box-shadow: none;
}

.button:hover {
  background: var(--brand-strong);
}

.button:disabled {
  opacity: 0.68;
  cursor: wait;
}

.button[aria-disabled="true"],
.button-secondary[aria-disabled="true"] {
  opacity: 0.58;
  cursor: not-allowed;
}

.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 2.9rem;
  padding: 0.78rem 1.2rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.button-secondary:hover {
  background: var(--surface-muted);
  border-color: #b8c5d1;
}

.button-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand-strong);
  text-decoration: none;
}

.button-link:hover {
  color: var(--brand);
  text-decoration: underline;
}

.button-danger {
  background: var(--danger);
}

.button-danger:hover {
  background: #8f211d;
}

.button:focus-visible,
.button-secondary:focus-visible,
.button-link:focus-visible,
.tool-menu-button:focus-visible,
.tool-menu-item:focus-visible,
.link-list a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 1px var(--focus), 0 0 0 4px rgba(47, 110, 229, 0.18);
}

.stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 2rem;
}

.step-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
}

.step-pill.is-active {
  border-color: rgba(199, 70, 52, 0.28);
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.step-pill.is-complete {
  border-color: rgba(47, 125, 50, 0.22);
  background: var(--success-soft);
  color: var(--success);
}

.step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  background: rgba(28, 39, 51, 0.08);
  font-weight: 700;
}

.step-pill.is-active .step-index {
  background: rgba(199, 70, 52, 0.16);
}

.step-pill.is-complete .step-index {
  background: rgba(47, 125, 50, 0.18);
}

.step-body {
  display: grid;
  gap: 1.1rem;
}

.instruction-card,
.status-card,
.callout {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.status-card strong,
.callout strong,
.tool-remove-summary strong {
  display: block;
  margin-bottom: 0.35rem;
}

.status-card p + p,
.tool-remove-summary p + p {
  margin-top: 0.35rem;
}

.field-group {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field label {
  color: var(--text);
  font-weight: 600;
}

.field small {
  color: #6b7785;
}

.field input,
.field select {
  width: 100%;
  min-height: 2.95rem;
  padding: 0.82rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 1px var(--focus), 0 0 0 4px rgba(47, 110, 229, 0.14);
}

.hint-list,
.link-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

.hint-list li + li,
.link-list li + li {
  margin-top: 0.45rem;
}

.link-list a {
  color: var(--info);
  text-decoration: none;
}

.link-list a:hover {
  text-decoration: underline;
}

.jira-site-table {
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) auto minmax(14rem, 1.2fr);
  gap: 0.75rem 1rem;
  align-items: center;
}

.jira-site-table-head {
  color: #6b7785;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.jira-site-table-head-action,
.jira-site-action {
  justify-self: end;
}

.jira-site-row {
  min-height: 3rem;
  display: flex;
  align-items: center;
  padding-top: 0.15rem;
  border-top: 1px solid var(--line);
}

.jira-site-name {
  color: var(--text);
  font-weight: 600;
}

.jira-pat-button {
  min-height: 2.35rem;
  padding: 0.5rem 0.8rem;
  text-decoration: none;
}

.jira-site-footer {
  margin-top: 0.9rem;
}

.jira-site-row-field {
  padding-top: 0.45rem;
}

.jira-custom-stack {
  display: grid;
  gap: 0.55rem;
  width: 100%;
}

.jira-site-inline-input {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.62rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.jira-site-inline-input:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 1px var(--focus), 0 0 0 4px rgba(47, 110, 229, 0.14);
}

.jira-remove-link {
  margin-top: 0.45rem;
}

.status-banner {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(178, 40, 34, 0.18);
  background: var(--danger-soft);
  color: #8f211d;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge[data-state="CREATING"],
.badge[data-state="Creating"] {
  background: var(--info-soft);
  color: var(--info);
}

.badge[data-state="ACTIVE"],
.badge[data-state="Active"] {
  background: var(--success-soft);
  color: var(--success);
}

.badge[data-state="UPDATING"],
.badge[data-state="Updating"] {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge[data-state="FAILED"],
.badge[data-state="Failed"] {
  background: var(--danger-soft);
  color: var(--danger);
}

.spinner,
.spinner-small {
  display: inline-flex;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
}

.spinner-small {
  width: 0.95rem;
  height: 0.95rem;
}

.loading-shell {
  min-height: 70vh;
  display: grid;
  place-items: center;
}

.loading-panel {
  display: grid;
  place-items: center;
  gap: 1rem;
  max-width: 24rem;
  padding: 2rem 2.25rem;
  text-align: center;
}

.mono {
  font-family: "Oracle Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

.tool-section {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.tool-section-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.tool-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.tool-card {
  position: relative;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  gap: 1rem;
}

.tool-card-header,
.tool-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
}

.tool-card-identity {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.tool-card-icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 700;
}

.tool-card-identity h3 {
  font-size: 1rem;
}

.tool-card-identity p {
  font-size: 0.94rem;
}

.tool-menu-shell {
  position: relative;
}

.tool-menu-button {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.tool-menu-button:hover {
  background: var(--surface-muted);
}

.tool-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  min-width: 10.5rem;
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 0.2rem;
  z-index: 5;
}

.tool-menu-item {
  padding: 0.7rem 0.8rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.tool-menu-item:hover {
  background: var(--surface-muted);
}

.tool-menu-item-danger {
  color: var(--danger);
}

.tool-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tool-empty {
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--line-strong);
  background: var(--surface-soft);
}

.overlay-shell {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 39, 51, 0.28);
  backdrop-filter: blur(2px);
}

.tool-drawer,
.confirmation-modal {
  position: relative;
  z-index: 1;
  width: min(100%, 40rem);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1.5rem;
  background: var(--surface);
}

.tool-drawer-header,
.tool-drawer-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.9rem;
  align-items: center;
}

.tool-drawer-header {
  margin-bottom: 1.1rem;
}

.tool-drawer-footer {
  margin-top: 1.25rem;
}

.callout-warning {
  border-color: rgba(167, 105, 0, 0.22);
  background: #fff7e5;
}

.tool-remove-summary {
  margin: 1rem 0;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.toast {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 40;
  min-width: 18rem;
  max-width: 28rem;
  padding: 0.9rem 1rem;
  border-left: 4px solid var(--success);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.toast[data-kind="error"] {
  border-left-color: var(--danger);
}

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

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .panel-main,
  .panel-side {
    padding: 1.4rem;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 1.1rem 0.85rem 2rem;
  }

  h1 {
    font-size: 2.25rem;
  }

  .meta-grid,
  .summary-grid,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .auth-actions,
  .wizard-actions,
  .inline-actions,
  .tool-drawer-header,
  .tool-drawer-footer,
  .tool-section-header,
  .tool-card-header,
  .toast {
    flex-direction: column;
    align-items: stretch;
  }

  .button,
  .button-secondary {
    width: 100%;
  }
}
