.guide-page {
  position: relative;
}

.guide-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: clamp(1rem, 3vw, 1.75rem);
  align-items: stretch;
  margin-bottom: clamp(1.25rem, 3vw, 1.75rem);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.5rem;
  background:
    radial-gradient(circle at 0% 0%, hsl(var(--primary) / 0.14), transparent 18rem),
    rgba(255, 255, 255, 0.04);
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: 0 22px 60px rgba(5, 3, 18, 0.28);
}

.guide-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  align-self: flex-start;
  border-radius: 999px;
  border: 1px solid hsl(var(--primary) / 0.28);
  background: hsl(var(--primary) / 0.08);
  color: hsl(var(--primary));
  padding: 0.22rem 0.55rem;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.guide-eyebrow svg {
  width: 0.7rem;
  height: 0.7rem;
}

.guide-hero__intro {
  display: flex;
  flex-direction: column;
  max-width: 38rem;
}

.guide-hero h1 {
  margin-top: 1.15rem;
  margin-bottom: 0;
  color: #fff;
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.12;
}

.guide-hero__desc {
  margin-top: 1.25rem;
  color: rgb(var(--muted-foreground));
  font-size: 0.95rem;
  line-height: 1.7;
}

.guide-hero__ip-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin-top: 0.65rem;
  padding: 0.85rem 1.05rem;
  border: 1px solid hsl(var(--primary) / 0.28);
  border-radius: 0.75rem;
  background:
    linear-gradient(135deg, hsl(var(--primary) / 0.12), transparent 55%),
    rgba(0, 0, 0, 0.22);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: clamp(1.2rem, 2.8vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.guide-hero__ip-bar:hover {
  border-color: hsl(var(--primary) / 0.45);
  background:
    linear-gradient(135deg, hsl(var(--primary) / 0.18), transparent 55%),
    rgba(0, 0, 0, 0.28);
  transform: translateY(-1px);
}

.guide-hero__ip-bar:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.45);
}

.guide-hero__ip-bar-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guide-hero__ip-bar-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: hsl(var(--primary));
}

.guide-hero__panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 18.5rem;
  border: 1px solid hsl(var(--primary) / 0.22);
  border-radius: 1.15rem;
  background: rgba(0, 0, 0, 0.22);
  padding: 1rem 1.05rem;
}

.guide-hero__panel > span {
  color: hsl(var(--primary));
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.guide-hero__panel-commands {
  margin: 0.5rem 0 0;
}

.guide-hero__panel-commands span {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.28rem 0.5rem;
}

.guide-hero__panel p {
  margin-top: 0.4rem;
  color: rgb(var(--muted-foreground));
  font-size: 0.8rem;
  line-height: 1.5;
}

.guide-hero__panel p strong {
  color: #fff;
  font-size: inherit;
  font-weight: 600;
}

.guide-quick-nav {
  position: sticky;
  top: 0.75rem;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  background: rgba(7, 7, 17, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.guide-quick-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  padding: 0.5rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 750;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.guide-quick-nav a:hover,
.guide-quick-nav a:focus-visible {
  border-color: hsl(var(--primary) / 0.35);
  background: hsl(var(--primary) / 0.12);
  transform: translateY(-1px);
}

.guide-quick-nav__danger {
  border-color: rgba(248, 113, 113, 0.28) !important;
  background: rgba(248, 113, 113, 0.08) !important;
  color: #fecaca !important;
}

.guide-quick-nav i {
  color: hsl(var(--primary));
}

.guide-grid {
  display: grid;
  gap: 1rem;
}

.guide-section {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
  scroll-margin-top: 5.5rem;
}

.guide-section--danger {
  border-color: rgba(248, 113, 113, 0.22);
  background:
    radial-gradient(circle at 100% 0%, rgba(248, 113, 113, 0.08), transparent 16rem),
    rgba(255, 255, 255, 0.03);
}

.guide-section__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: start;
  padding: 1.15rem 1.2rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.guide-section__head > span:first-child {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.75rem;
  background: hsl(var(--primary) / 0.14);
  color: hsl(var(--primary));
  font-size: 0.82rem;
  font-weight: 900;
}

.guide-section__head h2 {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.guide-section__head > div > p:not(.guide-section__intro) {
  margin-top: 0.25rem;
  color: rgb(var(--muted-foreground));
  font-size: 0.85rem;
  line-height: 1.5;
}

.guide-section__intro {
  margin-top: 0.45rem;
  color: rgb(var(--muted-foreground));
  font-size: 0.9rem;
  line-height: 1.65;
}

.guide-section--danger .guide-section__head {
  padding-bottom: 0.65rem;
}

.guide-section__body {
  padding: 1rem 1.2rem 1.2rem 4.55rem;
  color: rgb(var(--muted-foreground));
  font-size: 0.9rem;
  line-height: 1.7;
}

.guide-section__body ul {
  margin-top: 0.75rem;
  padding-left: 1.1rem;
}

.guide-section__body li + li {
  margin-top: 0.35rem;
}

.guide-command-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.85rem 0;
}

.guide-command-list span {
  display: inline-flex;
  align-items: center;
  border-radius: 0.55rem;
  border: 1px solid hsl(var(--primary) / 0.22);
  background: hsl(var(--primary) / 0.08);
  color: #fff;
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.guide-section__body--rules {
  padding-top: 0.65rem;
}

.guide-rules-hint {
  margin-top: 0;
  color: rgb(var(--muted-foreground));
  font-size: 0.78rem;
}

.guide-rules-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.55rem;
}

.guide-rule-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  background: rgba(0, 0, 0, 0.18);
  padding: 0.95rem;
}

.guide-rule-card h3 {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 900;
  margin-bottom: 0.65rem;
}

.guide-rule-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.guide-rule-list li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.guide-rule-list li:last-child {
  border-bottom: none;
}

.guide-rule-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  column-gap: 0.35rem;
  row-gap: 0.3rem;
  align-items: center;
  width: 100%;
  padding: 0.5rem 0.15rem;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
  border-radius: 0.45rem;
}

.guide-rule-item:hover,
.guide-rule-item:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  outline: none;
}

.guide-rule-item__label {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  font-weight: 700;
  color: #fff;
}

.guide-rule-item .guide-rule-badges {
  grid-column: 1;
  grid-row: 2;
}

.guide-rule-item__icon {
  grid-column: 2;
  grid-row: 1 / -1;
  align-self: center;
  width: 0.85rem;
  height: 0.85rem;
  flex-shrink: 0;
  color: hsl(var(--muted-foreground));
  opacity: 0.55;
  transition: opacity 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.guide-rule-item:hover .guide-rule-item__icon,
.guide-rule-item:focus-visible .guide-rule-item__icon {
  color: hsl(var(--primary));
  opacity: 1;
  transform: translateX(1px);
}

.guide-rule-panel {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
  visibility: hidden;
}

.guide-rule-panel.is-open {
  pointer-events: auto;
  visibility: visible;
}

.guide-rule-panel__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.25s ease;
  cursor: pointer;
}

.guide-rule-panel.is-open .guide-rule-panel__backdrop {
  opacity: 1;
}

.guide-rule-panel__sheet {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 24rem);
  max-height: 100%;
  margin-left: auto;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgb(16, 14, 34), rgb(22, 18, 44));
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.35);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  outline: none;
}

.guide-rule-panel.is-open .guide-rule-panel__sheet {
  transform: translateX(0);
}

.guide-rule-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.1rem 1.15rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.guide-rule-panel__category {
  display: inline-flex;
  color: hsl(var(--primary));
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.guide-rule-panel__title {
  margin-top: 0.25rem;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.3;
}

.guide-rule-panel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
}

.guide-rule-panel__close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.guide-rule-panel__body {
  overflow-y: auto;
  padding: 1rem 1.15rem 1.25rem;
}

.guide-rule-panel__badges {
  margin-bottom: 0.85rem;
}

.guide-rule-panel__detail {
  color: rgb(var(--muted-foreground));
  font-size: 0.86rem;
  line-height: 1.65;
}

body.guide-rule-panel-open {
  overflow: hidden;
}

.guide-rule-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.guide-rule-penalty,
.guide-rule-tax {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  font-style: normal;
  font-size: 0.65rem;
  font-weight: 800;
}

.guide-rule-penalty {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.28);
  color: #fecaca;
}

.guide-rule-tax {
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.28);
  color: #fde68a;
}

.guide-rule-card__note {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.75rem;
  line-height: 1.5;
}

.guide-rules-art {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid rgba(248, 113, 113, 0.22);
  border-radius: 1rem;
  background: rgba(248, 113, 113, 0.06);
  padding: 0.75rem 0.85rem;
}

.guide-rules-art__shield {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.85rem;
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
}

.guide-rules-art__text strong {
  display: block;
  color: #fff;
  font-size: 0.85rem;
}

.guide-rules-art__text span {
  display: block;
  margin-top: 0.15rem;
  color: rgb(var(--muted-foreground));
  font-size: 0.75rem;
}

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

  .guide-section__head {
    grid-template-columns: auto 1fr;
  }

  .guide-rules-art {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .guide-section__body {
    padding-left: 1.2rem;
  }

  .guide-rules-grid {
    grid-template-columns: 1fr;
  }

  .guide-rule-panel {
    align-items: flex-end;
  }

  .guide-rule-panel__sheet {
    width: 100%;
    max-height: 88vh;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem 1rem 0 0;
    transform: translateY(100%);
  }

  .guide-rule-panel.is-open .guide-rule-panel__sheet {
    transform: translateY(0);
  }
}