/**
 * AI Study Guide Generator.
 *
 * Scoped palette as with every other tool family. The one addition is the
 * `busy` status colour, because this is the only tool here that waits on a
 * server and the wait needs to look deliberate rather than broken.
 */

.sk-guide-root {
  --sk-ink: #28323a;
  --sk-muted: #66727b;
  --sk-accent: #68438b;
  --sk-accent-strong: #452b61;
  --sk-line: #dfe3e8;
  --sk-surface: #ffffff;
  --sk-soft: #f7f5fa;
  --sk-on-accent: #ffffff;
  --sk-error: #a6324a;
  --sk-ok: #1f6b45;

  display: block;
  box-sizing: border-box;
  margin: 20px auto 0;
  max-width: 860px;
  color: var(--sk-ink);
  font-family: inherit;
  line-height: 1.65;
}

html[data-sk-scheme="dark"] .sk-guide-root {
  --sk-ink: #e6e2ee;
  --sk-muted: #a79fba;
  --sk-accent: #cba4ec;
  --sk-accent-strong: #e3cff7;
  --sk-line: #38314a;
  --sk-surface: #221d2e;
  --sk-soft: #2b2140;
  --sk-on-accent: #2f1c40;
  --sk-error: #ff9fb0;
  --sk-ok: #7ed7a8;
}

.sk-guide-root * {
  box-sizing: border-box;
}

.sk-guide-field {
  margin: 0 0 16px;
}

.sk-guide-label {
  display: block;
  margin: 0 0 5px;
  font-size: 0.84rem;
  font-weight: 600;
}

.sk-guide-hint {
  margin: 0 0 7px;
  color: var(--sk-muted);
  font-size: 0.81rem;
}

.sk-guide-textarea,
.sk-guide-select {
  display: block;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--sk-line);
  border-radius: 8px;
  background: var(--sk-surface);
  color: var(--sk-ink);
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.6;
}

.sk-guide-textarea {
  resize: vertical;
  min-height: 150px;
}

.sk-guide-textarea::placeholder {
  color: #9a90a4;
}

html[data-sk-scheme="dark"] .sk-guide-textarea::placeholder {
  color: #8b83a0;
}

.sk-guide-textarea:focus-visible,
.sk-guide-select:focus-visible,
.sk-guide-build:focus-visible,
.sk-guide-btn:focus-visible {
  border-color: var(--sk-accent);
  outline: 2px solid var(--sk-accent);
  outline-offset: -1px;
}

.sk-guide-count {
  margin: 5px 0 0;
  color: var(--sk-muted);
  font-size: 0.77rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.sk-guide-count.is-over {
  color: var(--sk-error);
}

.sk-guide-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin: 0 0 18px;
  padding-top: 16px;
  border-top: 1px solid var(--sk-line);
}

.sk-guide-control {
  flex: 0 1 180px;
  min-width: 130px;
}

.sk-guide-control .sk-guide-label {
  font-size: 0.79rem;
  color: var(--sk-muted);
}

.sk-guide-build {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--sk-accent);
  color: var(--sk-on-accent);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.sk-guide-build:hover:not(:disabled) {
  background: var(--sk-accent-strong);
}

.sk-guide-build:disabled {
  opacity: 0.65;
  cursor: progress;
}

/* A left rule, like every other status on the site. */
.sk-guide-status:not(:empty) {
  margin: 0 0 16px;
  padding: 2px 0 2px 11px;
  border-left: 3px solid currentColor;
  font-size: 0.87rem;
  font-weight: 600;
}

.sk-guide-status.is-error { color: var(--sk-error); }
.sk-guide-status.is-busy { color: var(--sk-muted); }

/* ---- the guide ---------------------------------------------------------- */

.sk-guide-caveat {
  margin: 0 0 18px;
  padding: 10px 13px;
  border: 1px solid var(--sk-line);
  border-radius: 8px;
  background: var(--sk-soft);
  color: var(--sk-muted);
  font-size: 0.85rem;
}

.sk-guide-section {
  padding: 0 0 16px;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--sk-line);
}

.sk-guide-section:last-of-type {
  border-bottom: 0;
}

.sk-guide-h3 {
  display: flex;
  gap: 9px;
  margin: 0 0 7px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.sk-guide-num {
  flex: 0 0 auto;
  min-width: 20px;
  color: var(--sk-muted);
  font-variant-numeric: tabular-nums;
}

.sk-guide-explain {
  margin: 0 0 8px;
  font-size: 0.93rem;
}

.sk-guide-check {
  margin: 0;
  color: var(--sk-muted);
  font-size: 0.87rem;
}

.sk-guide-check-label {
  display: inline-block;
  margin-right: 7px;
  padding: 1px 7px;
  border: 1px solid var(--sk-line);
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sk-guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.sk-guide-btn {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--sk-accent);
  color: var(--sk-on-accent);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.sk-guide-btn:hover {
  background: var(--sk-accent-strong);
}

.sk-guide-btn--ghost {
  border-color: var(--sk-line);
  background: var(--sk-surface);
  color: var(--sk-muted);
}

.sk-guide-btn--ghost:hover {
  border-color: var(--sk-accent);
  background: var(--sk-surface);
  color: var(--sk-accent-strong);
}

.sk-guide-note {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--sk-line);
  color: var(--sk-muted);
  font-size: 0.79rem;
  line-height: 1.55;
}

@media (max-width: 620px) {
  .sk-guide-controls {
    gap: 10px;
  }

  .sk-guide-control {
    flex: 1 1 130px;
  }

  .sk-guide-build {
    flex: 1 1 100%;
    justify-content: center;
  }
}

@media print {
  body * { visibility: hidden; }

  .sk-guide-out,
  .sk-guide-out * {
    visibility: visible;
  }

  .sk-guide-out {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }

  .sk-guide-actions,
  .sk-guide-field,
  .sk-guide-controls,
  .sk-guide-status,
  .sk-guide-note {
    display: none !important;
  }
}
