.tips-tool {
  --tips-ink: #111827;
  --tips-muted: #4b5563;
  --tips-soft: #f9fafb;
  --tips-panel: #ffffff;
  --tips-line: #d1d5db;
  --tips-primary: #5a3b8c;
  --tips-primary-dark: #472d6f;
  --tips-accent: #0f766e;
  --tips-danger: #b91c1c;
  --tips-success: #0f766e;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 14px 56px;
  color: var(--tips-ink);
  font-family: "Poppins", "Segoe UI", sans-serif;
}

.tips-tool *,
.tips-tool *::before,
.tips-tool *::after {
  box-sizing: border-box;
}

.tips-tool__shell {
  display: grid;
  gap: 18px;
}

.tips-tool__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--tips-line);
  border-radius: 8px;
  background: var(--tips-panel);
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.06);
}

.tips-tool__eyebrow {
  margin: 0 0 6px;
  color: var(--tips-accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tips-tool__title,
.tips-tool h1,
.tips-tool h2,
.tips-tool h3 {
  margin: 0;
  color: var(--tips-ink);
  letter-spacing: 0;
}

.tips-tool__title {
  font-size: clamp(1.55rem, 2.4vw, 2.2rem);
  line-height: 1.15;
}

.tips-tool__intro,
.tips-tool__panel-head p,
.tips-tool__prompt-card p,
.tips-tool__helper p {
  margin: 8px 0 0;
  color: var(--tips-muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

.tips-tool__header-actions,
.tips-tool__actions,
.tips-tool__inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.tips-tool__grid {
  display: grid;
  grid-template-columns: minmax(190px, 0.75fr) minmax(0, 2.5fr) minmax(230px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.tips-tool__rail,
.tips-tool__reference,
.tips-tool__workspace {
  min-width: 0;
}

.tips-tool__phases {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  position: sticky;
  top: 96px;
}

.tips-tool__phase {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 68px;
  padding: 10px;
  border: 1px solid var(--tips-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--tips-ink);
  text-align: left;
  cursor: pointer;
}

.tips-tool__phase:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.tips-tool__phase strong,
.tips-tool__phase small {
  display: block;
}

.tips-tool__phase strong {
  font-size: 0.88rem;
  line-height: 1.25;
}

.tips-tool__phase small {
  margin-top: 3px;
  color: var(--tips-muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.tips-tool__phase-number {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f3f4f6;
  color: var(--tips-muted);
  font-weight: 700;
}

.tips-tool__phase--active {
  border-color: rgba(90, 59, 140, 0.42);
  box-shadow: 0 0 0 3px rgba(90, 59, 140, 0.08);
}

.tips-tool__phase--active .tips-tool__phase-number {
  background: var(--tips-primary);
  color: #ffffff;
}

.tips-tool__phase--locked {
  border-color: rgba(15, 118, 110, 0.38);
  background: #f3fbf8;
}

.tips-tool__phase--locked .tips-tool__phase-number {
  background: var(--tips-success);
  color: #ffffff;
}

.tips-tool__panel,
.tips-tool__reference-card,
.tips-tool__helper,
.tips-tool__notice {
  border: 1px solid var(--tips-line);
  border-radius: 8px;
  background: var(--tips-panel);
}

.tips-tool__panel {
  display: grid;
  gap: 16px;
  padding: 24px;
  box-shadow: 0 12px 24px rgba(17, 24, 39, 0.05);
}

.tips-tool__panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5e7eb;
}

.tips-tool__field {
  display: grid;
  gap: 8px;
}

.tips-tool__field span,
.tips-tool__check {
  color: var(--tips-ink);
  font-size: 0.86rem;
  font-weight: 650;
}

.tips-tool__field input,
.tips-tool__field textarea {
  width: 100%;
  border: 1px solid var(--tips-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--tips-ink);
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.5;
  padding: 10px 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tips-tool__field textarea {
  min-height: 148px;
  resize: vertical;
  font-family: "Courier New", monospace;
}

.tips-tool__field input:focus,
.tips-tool__field textarea:focus {
  outline: none;
  border-color: var(--tips-primary);
  box-shadow: 0 0 0 3px rgba(90, 59, 140, 0.14);
}

.tips-tool__prompt-card,
.tips-tool__parser-card,
.tips-tool__subsection,
.tips-tool__lock-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: var(--tips-soft);
}

.tips-tool__subsection {
  display: grid;
}

.tips-tool__parser-card {
  background: var(--tips-soft);
}

.tips-tool__lock-card {
  background: #f8f5ff;
  border-color: rgba(90, 59, 140, 0.22);
}

.tips-tool__lock-card p {
  margin: 6px 0 0;
  color: var(--tips-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.tips-tool__hint,
.tips-tool__parse-feedback {
  margin: 0;
  color: var(--tips-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.tips-tool__parse-feedback {
  margin-top: 6px;
  color: var(--tips-accent);
  font-weight: 650;
}

.tips-tool__guide {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: #f3fbf8;
}

.tips-tool__guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tips-tool__guide-head strong {
  color: var(--tips-ink);
}

.tips-tool__guide-head span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--tips-accent);
  font-size: 0.76rem;
  font-weight: 700;
}

.tips-tool__guide ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
}

.tips-tool__guide li {
  color: var(--tips-ink);
  font-size: 0.9rem;
  line-height: 1.45;
}

.tips-tool__guide p {
  margin: 0;
  color: var(--tips-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.tips-tool__subsection h3 {
  font-size: 1rem;
}

.tips-tool__button,
.tips-tool__tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 14px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.tips-tool__button:hover,
.tips-tool__tab:hover {
  transform: translateY(-1px);
}

.tips-tool__button:focus-visible,
.tips-tool__tab:focus-visible,
.tips-tool__phase:focus-visible {
  outline: 2px solid rgba(90, 59, 140, 0.35);
  outline-offset: 2px;
}

.tips-tool__button--primary {
  background: var(--tips-primary);
  color: #ffffff;
}

.tips-tool__button--primary:hover {
  background: var(--tips-primary-dark);
}

.tips-tool__button--secondary,
.tips-tool__button--ghost,
.tips-tool__tab {
  border-color: var(--tips-line);
  background: #ffffff;
  color: var(--tips-ink);
}

.tips-tool__button--ghost {
  color: var(--tips-muted);
}

.tips-tool__button--copy {
  background: #102c49;
  color: #ffffff;
}

.tips-tool__button--copy:hover {
  background: #0b233b;
}

.tips-tool__button.is-success {
  background: var(--tips-success);
  border-color: var(--tips-success);
  color: #ffffff;
}

.tips-tool__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: var(--tips-soft);
}

.tips-tool__tab.is-active {
  background: var(--tips-primary);
  color: #ffffff;
  border-color: var(--tips-primary);
}

.tips-tool__reference {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 96px;
}

.tips-tool__reference-card {
  padding: 24px;
}

.tips-tool__side-title {
  font-size: 0.98rem;
  line-height: 1.3;
}

.tips-tool__meta {
  display: grid;
  gap: 11px;
  margin: 13px 0 0;
}

.tips-tool__meta div {
  display: grid;
  gap: 3px;
}

.tips-tool__meta dt {
  color: var(--tips-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.tips-tool__meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--tips-ink);
  font-size: 0.88rem;
  line-height: 1.45;
}

.tips-tool__links {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.tips-tool__links a {
  color: var(--tips-primary);
  font-weight: 650;
  text-decoration: none;
}

.tips-tool__links a:hover {
  text-decoration: underline;
}

.tips-tool__selected-angles {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.tips-tool__selected-angles p {
  margin: 0;
  padding: 9px;
  border-radius: 8px;
  background: var(--tips-soft);
  color: var(--tips-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.tips-tool__summary {
  display: grid;
  gap: 12px;
}

.tips-tool__summary-row {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: var(--tips-soft);
}

.tips-tool__summary-row strong {
  color: var(--tips-ink);
  font-size: 0.84rem;
}

.tips-tool__summary-row pre {
  max-height: 220px;
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--tips-muted);
  font-family: "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.5;
}

.tips-tool__helper {
  padding: 16px;
  background: #fffaf5;
  border-color: rgba(245, 158, 11, 0.38);
}

.tips-tool__helper h3 {
  font-size: 1rem;
}

.tips-tool__helper ol {
  margin: 10px 0 0;
  padding-left: 22px;
}

.tips-tool__helper li {
  margin: 6px 0;
  color: var(--tips-ink);
  font-size: 0.9rem;
  line-height: 1.45;
}

.tips-tool__notice {
  padding: 12px 14px;
  color: #7f1d1d;
  background: #fef2f2;
  border-color: #fecaca;
}

.tips-tool__error {
  padding: 18px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #7f1d1d;
}

.tips-tool__draft-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.tips-tool__draft-box {
  display: grid;
  gap: 8px;
  padding: 14px;
  margin-top: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.tips-tool__draft-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tips-tool__draft-head strong {
  color: var(--tips-primary);
  font-size: 0.88rem;
}

.tips-tool__subsection {
  position: relative;
  transition: opacity 0.25s ease, filter 0.25s ease;
}

.tips-tool__subsection--locked {
  opacity: 0.65;
  filter: grayscale(15%);
  pointer-events: none;
  user-select: none;
  margin-top: 24px;
}

.tips-tool__subsection--locked::before {
  content: attr(data-locked-message);
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -20px;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 8px 16px;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  color: #b45309;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.1);
  pointer-events: auto;
}

@media (max-width: 1040px) {
  .tips-tool__grid {
    grid-template-columns: 1fr;
  }

  .tips-tool__phases,
  .tips-tool__reference {
    position: static;
  }

  .tips-tool__phases {
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    overflow-x: auto;
    padding-bottom: 2px;
  }
}

@media (max-width: 680px) {
  .tips-tool {
    padding: 16px 10px 40px;
  }

  .tips-tool__header,
  .tips-tool__panel-head,
  .tips-tool__prompt-card,
  .tips-tool__lock-card,
  .tips-tool__guide-head {
    display: grid;
  }

  .tips-tool__header,
  .tips-tool__panel,
  .tips-tool__reference-card {
    padding: 18px;
  }

  .tips-tool__header-actions,
  .tips-tool__actions,
  .tips-tool__tabs {
    width: 100%;
  }

  .tips-tool__button,
  .tips-tool__tab {
    width: 100%;
  }

  .tips-tool__phases {
    grid-template-columns: 1fr;
    overflow: visible;
  }
}
