/* WebDevWorker AI Studio — premium instrument styling.
   Dark/Dim only. AdSense and site chrome untouched. */

.ai-studio { max-width: 980px; margin: 0 auto; }

.ai-hero {
  position: relative;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 20px;
  padding: 34px 30px;
  margin-bottom: 26px;
  background:
    radial-gradient(600px 200px at 15% 0%, rgba(16, 185, 129, 0.12), transparent 60%),
    radial-gradient(500px 220px at 90% 20%, rgba(99, 102, 241, 0.10), transparent 60%),
    var(--bg-surface);
  overflow: hidden;
}
.ai-hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: #10b981; background: rgba(16, 185, 129, 0.10);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 5px 14px; border-radius: 9999px; margin-bottom: 14px;
}
.ai-hero-badge .pulse { width: 8px; height: 8px; border-radius: 50%; background: #10b981; box-shadow: 0 0 10px #10b981; animation: ai-pulse 1.8s infinite; }
@keyframes ai-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.ai-hero h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 10px; color: var(--text-main); }
.ai-hero h1 .grad {
  background: linear-gradient(120deg, #10b981, #34d399 40%, #818cf8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ai-hero p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.65; max-width: 720px; margin: 0 0 6px; }
.ai-free-row { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; font-size: 0.78rem; color: var(--text-dim); }
.ai-free-row span { display: inline-flex; align-items: center; gap: 6px; }

.ai-workbench {
  border: 1px solid var(--border); border-radius: 18px;
  background: var(--bg-surface); padding: 26px;
  box-shadow: var(--shadow-card);
}
.ai-field { margin-bottom: 18px; }
.ai-field label { display: block; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 8px; }
.ai-field textarea, .ai-field input[type="text"], .ai-field input[type="number"], .ai-field input[type="date"], .ai-field input[type="tel"], .ai-field select {
  width: 100%; background: var(--bg-body); color: var(--text-main);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 13px 15px; font-size: 0.92rem; line-height: 1.6; font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ai-field textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; min-height: 90px; }
.ai-field textarea:focus, .ai-field input:focus, .ai-field select:focus {
  outline: none; border-color: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}
.ai-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .ai-field-row { grid-template-columns: 1fr; } }

.ai-run-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff; font-weight: 800; font-size: 1rem;
  border: none; border-radius: 14px; padding: 15px 34px; cursor: pointer;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
  transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s;
}
.ai-run-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(16, 185, 129, 0.45); }
.ai-run-btn:active:not(:disabled) { transform: translateY(0) scale(0.97); box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35); }
.ai-run-btn:disabled { opacity: 0.65; cursor: wait; }
.ai-run-btn .ai-spark { font-size: 1.2rem; }
@keyframes ai-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
.ai-shake { animation: ai-shake 0.35s ease; }

.ai-output-wrap { display: none; margin-top: 26px; }
.ai-output {
  border: 1px solid rgba(16, 185, 129, 0.22); border-radius: 16px;
  background: rgba(0, 0, 0, 0.25); padding: 24px; min-height: 120px;
}
.ai-output .ai-p { color: var(--text-main); font-size: 0.92rem; line-height: 1.7; margin: 0 0 12px; }
.ai-output .ai-h { color: var(--text-main); font-weight: 800; margin: 20px 0 10px; letter-spacing: -0.01em; }
.ai-output h2.ai-h { font-size: 1.12rem; } .ai-output h3.ai-h { font-size: 1rem; } .ai-output h4.ai-h { font-size: 0.92rem; }
.ai-output .ai-list { margin: 0 0 14px 4px; padding-left: 20px; color: var(--text-main); font-size: 0.92rem; line-height: 1.7; }
.ai-output .ai-list li { margin-bottom: 6px; }
.ai-output strong { color: #34d399; }
.ai-inline-code {
  background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.25);
  color: #6ee7b7; padding: 1px 7px; border-radius: 6px; font-size: 0.85em;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ai-codeblock { margin: 14px 0; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.10); }
.ai-codeblock-bar {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(255, 255, 255, 0.04); padding: 8px 14px;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim);
}
.ai-copy-btn {
  background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 8px; padding: 4px 12px; font-size: 0.72rem; font-weight: 700; cursor: pointer;
  min-width: 96px; white-space: nowrap; box-sizing: border-box;
}
.ai-copy-btn.copied, .ai-copy-btn:hover { background: #059669; color: #fff; }
.ai-codeblock pre { margin: 0; padding: 16px; overflow-x: auto; background: rgba(0, 0, 0, 0.45); }
.ai-codeblock code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; line-height: 1.65; color: #e2e8f0; }

.ai-thinking { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 0.9rem; padding: 20px 4px; }
.ai-thinking span { width: 9px; height: 9px; border-radius: 50%; background: #10b981; animation: ai-blink 1.2s infinite; }
.ai-thinking span:nth-child(2) { animation-delay: 0.2s; } .ai-thinking span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ai-blink { 0%, 100% { opacity: 0.25; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1.1); } }

.ai-error {
  display: none; margin-top: 16px; padding: 13px 18px; border-radius: 12px;
  background: rgba(239, 68, 68, 0.10); border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5; font-size: 0.88rem; font-weight: 600;
}
.ai-note { font-size: 0.78rem; color: var(--text-dim); margin-top: 10px; line-height: 1.6; }

/* verify panels */
.ai-verify {
  margin-top: 22px; border: 1px dashed rgba(16, 185, 129, 0.35); border-radius: 14px; padding: 20px;
  background: rgba(16, 185, 129, 0.04);
}
.ai-verify h3 { font-size: 0.95rem; font-weight: 800; color: var(--text-main); margin: 0 0 4px; }
.ai-verify .ai-verify-sub { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 14px; }
.ai-rx-out { margin-top: 12px; }
.ai-rx-count { font-size: 0.82rem; font-weight: 800; color: #34d399; margin-bottom: 8px; }
.ai-rx-hl { font-family: ui-monospace, Menlo, monospace; font-size: 0.85rem; line-height: 1.7; background: rgba(0,0,0,0.35); border-radius: 10px; padding: 14px; white-space: pre-wrap; word-break: break-word; color: var(--text-main); }
.ai-rx-hl mark { background: rgba(16, 185, 129, 0.45); color: #fff; border-radius: 3px; padding: 0 2px; }
.ai-rx-err { color: #fca5a5; font-weight: 600; font-size: 0.88rem; }
.ai-rx-dim { color: var(--text-dim); }
.ai-api-status { display: inline-block; font-weight: 800; font-size: 0.85rem; padding: 6px 14px; border-radius: 9999px; margin-bottom: 10px; }
.ai-api-status.ok { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.ai-api-status.bad { background: rgba(239, 68, 68, 0.12); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.4); }

/* micro-app smith */
.ai-examples { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.ai-examples-label { font-size: 0.78rem; font-weight: 700; color: var(--text-dim); align-self: center; }
.ai-example-chip {
  background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7; border-radius: 9999px; padding: 8px 16px;
  font-size: 0.8rem; font-weight: 700; cursor: pointer; transition: all 0.15s ease;
}
.ai-example-chip:hover { background: rgba(16, 185, 129, 0.18); border-color: rgba(16, 185, 129, 0.6); }
.ai-example-chip:active { transform: scale(0.95); }
.ai-ma-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.ai-ma-head h3 { margin: 0; font-size: 1.1rem; font-weight: 800; color: var(--text-main); letter-spacing: -0.01em; }
.ai-ma-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-ma-dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 16px; }
.ai-ma-dashcard {
  background: rgba(16, 185, 129, 0.07); border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 10px; padding: 10px 12px; text-align: center;
}
.ai-ma-dashval { font-size: 1.35rem; font-weight: 800; color: #34d399; letter-spacing: -0.02em; line-height: 1.2; }
.ai-ma-dashlabel { font-size: 0.68rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }
.ai-mini-btn {
  background: rgba(16, 185, 129, 0.12); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 8px; padding: 6px 12px; font-size: 0.75rem; font-weight: 700; cursor: pointer; white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.ai-mini-btn:hover { background: #059669; color: #fff; }
.ai-mini-btn:active { transform: scale(0.93); }
.ai-mini-btn.danger { background: rgba(239, 68, 68, 0.10); color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
.ai-mini-btn.danger:hover { background: #dc2626; color: #fff; }
.ai-ma-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 16px; }
.ai-ma-form .ai-field { margin-bottom: 0; }
.ai-ma-tablewrap { overflow-x: auto; margin-top: 16px; border: 1px solid var(--border); border-radius: 12px; }
.ai-ma-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.ai-ma-table th {
  text-align: left; padding: 10px 12px; background: rgba(16, 185, 129, 0.08);
  color: #6ee7b7; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap;
}
.ai-ma-table td { padding: 10px 12px; border-top: 1px solid var(--border); color: var(--text-main); vertical-align: middle; }
.ai-ma-acts { white-space: nowrap; }
.ai-ma-empty { padding: 18px; text-align: center; color: var(--text-dim); font-size: 0.85rem; }
.ai-ma-count { font-size: 0.78rem; color: var(--text-dim); margin-top: 10px; }
.ai-lib-strip { display: flex; gap: 10px; flex-wrap: wrap; }
.ai-lib-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(16, 185, 129, 0.07); border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 9999px; padding: 5px 6px 5px 14px;
}
.ai-lib-open { background: none; border: none; color: #6ee7b7; font-weight: 700; font-size: 0.8rem; cursor: pointer; padding: 0; font-family: inherit; }
.ai-lib-open:hover { color: #fff; }
.ai-lib-del {
  background: rgba(239, 68, 68, 0.12); border: none; color: #fca5a5; border-radius: 50%;
  width: 22px; height: 22px; font-size: 0.65rem; cursor: pointer; line-height: 1;
}
.ai-lib-del:hover { background: #dc2626; color: #fff; }

/* homepage AI Studio cards */
.ai-studio-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 26px 0 8px; }
@media (max-width: 900px) { .ai-studio-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .ai-studio-grid { grid-template-columns: 1fr; } }
.ai-studio-card {
  position: relative; display: block; text-decoration: none;
  border: 1px solid rgba(16, 185, 129, 0.22); border-radius: 16px; padding: 22px;
  background: linear-gradient(160deg, rgba(16, 185, 129, 0.07), rgba(99, 102, 241, 0.05)), var(--bg-surface);
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s;
}
.ai-studio-card:hover { transform: translateY(-3px); border-color: rgba(16, 185, 129, 0.55); box-shadow: 0 14px 34px -10px rgba(16, 185, 129, 0.35); }
.ai-studio-card .ai-card-icon { font-size: 1.7rem; margin-bottom: 10px; }
.ai-studio-card h3 { font-size: 1rem; font-weight: 800; color: var(--text-main); margin: 0 0 8px; letter-spacing: -0.01em; }
.ai-studio-card p { font-size: 0.83rem; color: var(--text-muted); line-height: 1.6; margin: 0 0 12px; }
.ai-studio-card .ai-card-cta { font-size: 0.8rem; font-weight: 800; color: #34d399; }
.ai-studio-card .ai-card-tag {
  position: absolute; top: 14px; right: 14px; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.06em;
  color: #10b981; background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 3px 9px; border-radius: 9999px; text-transform: uppercase;
}
