/* AI Crawler robots.txt Generator — tool-specific styles (loaded on this tool only). */

.acg-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ti-border);
}

.acg-save { margin: 0; }

.acg-jump {
  display: none;
  text-decoration: none;
}

/* ---------- Policy presets ---------- */
.acg-policy {
  margin: 0 0 24px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.acg-policy__title {
  margin-bottom: 12px;
  padding: 0;
  font-size: 20px;
  font-weight: var(--ti-fw-bold);
}

.acg-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.acg-preset {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--ti-border-strong);
  border-radius: var(--ti-radius-lg);
  background: var(--ti-white);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.acg-preset:hover { border-color: var(--ti-primary); }

.acg-preset input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--ti-primary);
}

.acg-preset:has(input:checked) {
  border-color: var(--ti-primary);
  background: var(--ti-primary-tint);
  box-shadow: inset 0 0 0 1px var(--ti-primary);
}

.acg-preset:has(input:focus-visible) { box-shadow: var(--ti-focus); }

.acg-preset__body { display: grid; gap: 4px; min-width: 0; }
.acg-preset__title { font-weight: var(--ti-fw-bold); color: var(--ti-text-color); }
.acg-preset__desc { color: var(--ti-muted-color); line-height: 1.45; }

/* ---------- Form steps ---------- */
.acg-step { margin-bottom: 24px; }

.acg-step__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.acg-step__intro { margin: -4px 0 14px; }

.acg-tag {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--ti-bg);
  font-size: 16px;
  font-weight: var(--ti-fw-semi);
  color: var(--ti-muted-color);
}

.acg-tag--rec {
  background: var(--ti-primary-tint);
  color: var(--ti-primary);
}

.acg-total {
  font-weight: var(--ti-fw-semi);
  color: var(--ti-muted-color);
}

.acg-current { min-height: 190px; }
.acg-current.is-drop { border-color: var(--ti-primary); background: var(--ti-primary-tint); }

.acg-current__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 14px;
  margin-top: 10px;
}

.acg-current__help { flex: 1 1 260px; margin: 0; }
.acg-file-btn { position: relative; cursor: pointer; }
.acg-file-btn:focus-within { box-shadow: var(--ti-focus); }

/* ---------- Bot groups ---------- */
.acg-group {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid var(--ti-border);
  border-radius: var(--ti-radius-lg);
  background: var(--ti-white);
}

.acg-group__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
}

.acg-group__title {
  margin: 0;
  font-size: 18px;
  font-weight: var(--ti-fw-bold);
}

.acg-group__count {
  color: var(--ti-muted-color);
}

.acg-group__bulk {
  display: flex;
  gap: 14px;
  margin-left: auto;
}

.acg-group__help { margin: 6px 0 12px; }

.acg-link-btn {
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--ti-font);
  font-size: 16px;
  font-weight: var(--ti-fw-semi);
  color: var(--ti-primary);
  cursor: pointer;
}

.acg-link-btn:hover { text-decoration: underline; }
.acg-link-btn:focus-visible { outline: none; box-shadow: var(--ti-focus); border-radius: 4px; }

.acg-bots {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.acg-bot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--ti-border);
  border-left: 4px solid var(--ti-border-strong);
  border-radius: var(--ti-radius-sm);
  background: var(--ti-bg);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.acg-bot.is-blocked {
  border-left-color: #DC2626;
  background: #FFF7F7;
}

.acg-bot__main { display: grid; gap: 4px; min-width: 0; }

.acg-bot__name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.acg-bot__token {
  padding: 0;
  background: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 16px;
  font-weight: var(--ti-fw-bold);
  color: var(--ti-text-color);
  overflow-wrap: anywhere;
}

.acg-bot__co { color: var(--ti-muted-color); }
.acg-bot__desc { margin: 0; line-height: 1.5; }

.acg-bot__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}

.acg-bot__doc { font-weight: var(--ti-fw-semi); }

.acg-flag {
  padding: 0 10px;
  border-radius: 999px;
  font-size: 16px;
}

.acg-flag--ok { background: rgba(22, 163, 74, 0.12); color: #166534; }
.acg-flag--warn { background: rgba(217, 119, 6, 0.14); color: #92400E; }
.acg-flag--info { background: var(--ti-primary-tint); color: #3730A3; }
.acg-flag--muted { background: rgba(71, 85, 105, 0.12); color: #334155; }

/* Switch */
.acg-switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 0;
  font-weight: var(--ti-fw-semi);
  cursor: pointer;
  user-select: none;
}

.acg-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.acg-switch__track {
  position: relative;
  flex-shrink: 0;
  width: 50px;
  height: 28px;
  border-radius: 999px;
  background: #94A3B8;
  transition: background-color 0.15s ease;
}

.acg-switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.3);
  transition: transform 0.15s ease;
}

.acg-switch input:checked + .acg-switch__track { background: #DC2626; }
.acg-switch input:checked + .acg-switch__track::after { transform: translateX(22px); }
.acg-switch input:focus-visible + .acg-switch__track { box-shadow: var(--ti-focus); }

@media (prefers-reduced-motion: reduce) {
  .acg-switch__track, .acg-switch__track::after, .acg-bot, .acg-preset { transition: none; }
}

/* ---------- Collapsible sections ---------- */
.acg-sec {
  margin-bottom: 12px;
  border: 1px solid var(--ti-border);
  border-radius: var(--ti-radius-lg);
  background: var(--ti-white);
}

.acg-sec > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  border-radius: var(--ti-radius-lg);
}

.acg-sec > summary::-webkit-details-marker { display: none; }

.acg-sec > summary::before {
  content: "";
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--ti-primary);
  border-bottom: 2px solid var(--ti-primary);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.acg-sec[open] > summary::before { transform: rotate(45deg); }
.acg-sec > summary:hover { background: var(--ti-bg); }
.acg-sec > summary:focus-visible { outline: none; box-shadow: var(--ti-focus); }

.acg-sec__title {
  flex: 1;
  margin: 0;
  font-size: 18px;
  font-weight: var(--ti-fw-bold);
}

.acg-sec__body { padding: 4px 18px 18px; }
.acg-indent { margin: 4px 0 12px 30px; }
.acg-indent[hidden] { display: none; }
.acg-ta-sm { min-height: 96px; }
.acg-signals__row { display: grid; gap: 0 12px; }
.acg-know p { margin: 0 0 12px; line-height: 1.55; }
.acg-know p:last-child { margin-bottom: 0; }

/* ---------- Output ---------- */
.acg-out {
  position: sticky;
  top: calc(var(--ti-header-h) + 16px);
  padding: 20px;
  border: 1px solid var(--ti-border);
  border-radius: var(--ti-radius-lg);
  background: var(--ti-white);
  box-shadow: var(--ti-shadow-sm);
}

.admin-bar .acg-out { top: calc(var(--ti-header-h) + 48px); }
.acg-out.is-static { position: static; }
.acg-out:focus { outline: none; }

.acg-output {
  min-height: 200px;
  max-height: 60vh;
  color: #E2E8F0;
}

.acg-hl-c { color: #94A3B8; }
.acg-hl-k { color: #C4B5FD; }
.acg-hl-no { color: #FCA5A5; }
.acg-hl-yes { color: #86EFAC; }

.acg-out__actions { margin: 14px 0 16px; }

.acg-chip {
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--ti-bg);
  font-weight: var(--ti-fw-semi);
  color: var(--ti-muted-color);
}

.acg-chip--on { background: rgba(220, 38, 38, 0.1); color: #991B1B; }

.acg-sub {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: var(--ti-fw-bold);
}

.acg-changes__list {
  display: grid;
  gap: 4px;
  margin: 0 0 14px;
  padding-left: 22px;
}

.acg-install { margin: 0; }

/* ---------- Checks and URL test ---------- */
.acg-bottom { margin-top: 24px; }

.acg-panel {
  padding: 20px;
  border: 1px solid var(--ti-border);
  border-radius: var(--ti-radius-lg);
  background: var(--ti-white);
}

.acg-panel .ti-app-panel__title { margin-bottom: 14px; }

.acg-summary { margin-bottom: 12px; }

.ti-issue--error { border-left: 4px solid #DC2626; }
.ti-issue--warn  { border-left: 4px solid #D97706; }
.ti-issue--ok    { border-left: 4px solid #16A34A; }
.ti-issue--info  { border-left: 4px solid var(--ti-primary); }
.acg-checks .ti-issue p { margin: 6px 0 0; }

.acg-test-sum__text { margin: 0 0 10px; overflow-wrap: anywhere; }

.acg-test-wrap {
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--ti-border);
  border-radius: var(--ti-radius-sm);
}

.acg-test thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.acg-test th[scope="row"] { font-weight: 400; white-space: nowrap; }
.acg-test code { font-size: 16px; background: none; padding: 0; }
.acg-test td:last-child { color: var(--ti-muted-color); }

.acg-res {
  display: inline-block;
  padding: 0 10px;
  border-radius: 999px;
  font-weight: var(--ti-fw-semi);
  white-space: nowrap;
}

.acg-res--yes { background: rgba(22, 163, 74, 0.12); color: #166534; }
.acg-res--no { background: rgba(220, 38, 38, 0.1); color: #991B1B; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .acg-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px), (max-height: 720px) {
  .acg-out,
  .admin-bar .acg-out { position: static; }
  .acg-output { max-height: 60vh; }
}

@media (max-width: 980px) {
  .acg-jump { display: inline-flex; }
}

@media (max-width: 640px) {
  .acg-presets { grid-template-columns: minmax(0, 1fr); }
  .acg-bot { gap: 10px; padding: 12px; }
  .acg-switch__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .acg-group { padding: 12px; }
  .acg-group__bulk { margin-left: 0; width: 100%; }
  .acg-sec__body { padding: 4px 14px 16px; }
  .acg-sec > summary { padding: 14px; }
  .acg-indent { margin-left: 0; }
  .acg-signals__row { grid-template-columns: minmax(0, 1fr); }
  .acg-out, .acg-panel { padding: 14px; }
  .acg-test th[scope="row"] { white-space: normal; overflow-wrap: anywhere; }
}

.acg-test-wrap:focus-visible { outline: none; box-shadow: var(--ti-focus); }
