*{box-sizing:border-box}html{font-family:Arial,"Helvetica Neue",Tahoma,sans-serif}body{margin:0;font-family:Arial,"Helvetica Neue",Tahoma,sans-serif;background:linear-gradient(135deg,#eef4ff,#f8fafc);color:#111827}.app{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px}.card{width:100%;max-width:1100px;background:#fff;border-radius:24px;padding:30px;box-shadow:0 24px 70px rgba(15,23,42,.12)}.card.small{max-width:460px}.topbar,.list-head{display:flex;justify-content:space-between;align-items:center;gap:12px}.list-actions{display:flex;gap:8px}.badge{display:inline-block;background:#dbeafe;color:#1d4ed8;border-radius:999px;padding:7px 12px;font-weight:700}.admin-link{color:#2563eb;font-weight:700;text-decoration:none}h1{margin:12px 0 8px;font-size:34px}h2{margin:0;font-size:22px}.sub,.hint{margin:0 0 24px;color:#6b7280;line-height:1.5}.hint{margin:8px 0 0;font-size:14px}label{display:block;font-weight:700;margin:16px 0 8px}textarea,select,.input{width:100%;border:1px solid #d1d5db;border-radius:14px;padding:14px;font-size:16px;background:#fff;font-family:Arial,"Helvetica Neue",Tahoma,sans-serif}textarea{min-height:170px;resize:vertical}.grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px}button{margin-top:20px;border:0;border-radius:14px;padding:14px 22px;background:#2563eb;color:white;font-size:16px;font-weight:700;cursor:pointer;font-family:Arial,"Helvetica Neue",Tahoma,sans-serif}.smallbtn{margin:0;padding:10px 14px;font-size:14px}.ghost{background:#eef2ff;color:#2563eb}button:disabled{opacity:.6;cursor:not-allowed}#status{margin-top:18px;font-weight:700}pre{margin-top:16px;background:#111827;color:#e5e7eb;padding:16px;border-radius:14px;overflow:auto;max-height:320px}.debug{margin-top:16px}.debug summary{cursor:pointer;font-weight:700}.success,.error,.note{padding:13px 15px;border-radius:14px;margin:16px 0}.success{background:#dcfce7;color:#166534}.error{background:#fee2e2;color:#991b1b}.note{background:#fef3c7;color:#92400e}hr{border:0;border-top:1px solid #e5e7eb;margin:28px 0}.jobs{margin-top:14px;border:1px solid #e5e7eb;border-radius:16px;overflow:hidden}.job{display:grid;grid-template-columns:1.2fr 1fr;gap:12px;padding:14px 16px;border-bottom:1px solid #e5e7eb;align-items:center}.job:last-child{border-bottom:0}.job-title{font-weight:800}.job-meta,.job-id{color:#6b7280;font-size:13px;margin-top:4px}.job-actions{display:flex;align-items:center;gap:10px;justify-content:flex-end}.job-actions audio{max-width:260px;width:100%}.download{background:#eef2ff;color:#2563eb;text-decoration:none;font-weight:800;border-radius:12px;padding:10px 12px}.ok{color:#16a34a;font-weight:800}.wait{color:#d97706;font-weight:800}.empty{padding:18px;color:#6b7280}.actions{display:flex;gap:12px;align-items:center;margin-top:12px}.actions a{color:#2563eb;font-weight:700}@media(max-width:820px){.grid,.job{grid-template-columns:1fr}.topbar,.list-head{align-items:flex-start;flex-direction:column}.job-actions{justify-content:flex-start;flex-wrap:wrap}h1{font-size:26px}.card{padding:20px}}

/* V9 polish */
.job-id{display:none}
.tall{min-height:260px;font-family:Consolas,monospace}
.download{white-space:nowrap}
.job-title{line-height:1.35}
.job-meta{line-height:1.5}
audio{height:42px}

/* V13 quality polish */
select option { color:#111827; background:#fff; }
.note { line-height:1.55; }
.ghost{background:#eef2ff;color:#2563eb}

/* V14 limits & keys */
.soft-note{border:1px solid #dbeafe;background:#eff6ff;color:#1e40af;border-radius:14px;padding:13px 14px;line-height:1.4}
.key-grid{grid-template-columns:1fr 2fr}
@media(max-width:820px){.key-grid{grid-template-columns:1fr}}

/* V15 key ui */
.list-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.tall{min-height:260px;font-family:Consolas,monospace}
.ghost{background:#eef2ff;color:#2563eb}

/* V16 free quota */
#quotaBox{margin-top:16px;margin-bottom:12px}
#keyBox{margin-top:8px}

/* V17 footer & device quota */
.site-footer{max-width:1100px;margin:0 auto 28px;padding:0 24px 24px;color:#6b7280;text-align:center;font-size:14px}
.footer-links{margin-top:8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap}
.footer-links a{color:#2563eb;text-decoration:none;font-weight:700}

/* V18 tabs */
.input-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0 10px}
.tab-btn{margin:0;border:1px solid #dbeafe;background:#eff6ff;color:#1d4ed8;border-radius:999px;padding:10px 14px;font-size:14px}
.tab-btn.active{background:#2563eb;color:#fff;border-color:#2563eb}
.tab-panel{display:none}
.tab-panel.active{display:block}
.tab-panel .soft-note{margin-top:10px}

/* V19 resource tabs */
.resource-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:18px 0 10px}
.resource-tab-btn{margin:0;border:1px solid #dbeafe;background:#eff6ff;color:#1d4ed8;border-radius:999px;padding:10px 14px;font-size:14px}
.resource-tab-btn.active{background:#2563eb;color:#fff;border-color:#2563eb}
.resource-panel{display:none;border:1px solid #e5e7eb;border-radius:16px;padding:16px;margin-bottom:16px;background:#f8fafc}
.resource-panel.active{display:block}
.resource-panel iframe{max-width:100%;border-radius:14px}
.resource-panel a{color:#2563eb;font-weight:700}

/* V20 key activation */
.key-active{margin-top:12px;background:#dcfce7!important;color:#166534!important;border-color:#bbf7d0!important;font-weight:700}
#keyNote{color:#1d4ed8}

/* V21 points */
.point-note{margin-top:8px;font-size:13px;opacity:.9}

/* V22 watch video gate */
.watch-modal{position:fixed;inset:0;background:rgba(15,23,42,.72);z-index:9999;align-items:center;justify-content:center;padding:18px}
.watch-box{width:min(760px,100%);background:#fff;color:#111827;border-radius:24px;padding:24px;box-shadow:0 30px 80px rgba(0,0,0,.35)}
.watch-box h2{margin-top:0}
.watch-video{margin:16px 0;border-radius:16px;overflow:hidden;background:#0f172a}
.watch-video iframe,.watch-video video{width:100%;max-width:100%;border-radius:16px}
.watch-count{font-weight:800;margin:12px 0;color:#1d4ed8}
.watch-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap}
.watch-actions button:disabled{opacity:.45;cursor:not-allowed}

/* V24 video pass once */
.point-note{display:none!important}

/* V25 real watch */
.watch-count{user-select:none}

/* V27 key persist */
#quotaBox[style*="display: none"]{margin:0;padding:0;border:0}

/* V28 character counter */
.char-counter{
  margin-top:10px;
  padding:10px 12px;
  border:1px solid #334155;
  background:rgba(15,23,42,.35);
  border-radius:12px;
  color:#93c5fd;
  font-size:14px;
  line-height:1.45;
}
.char-counter b{color:#bfdbfe}
.char-counter.warn{
  border-color:#f59e0b;
  color:#fbbf24;
}
.char-counter.warn b{color:#fde68a}
.char-counter.danger{
  border-color:#ef4444;
  color:#fca5a5;
  background:rgba(127,29,29,.25);
}
.char-counter.danger b{color:#fecaca}

/* V29 clean blue-black UI */
.char-counter{
  margin-top:10px!important;
  padding:10px 12px!important;
  border:1px solid #2563eb!important;
  background:#ffffff!important;
  border-radius:12px!important;
  color:#111827!important;
  font-size:14px!important;
  line-height:1.45!important;
  box-shadow:none!important;
}
.char-counter b{color:#2563eb!important}
.char-counter.warn{
  border-color:#2563eb!important;
  color:#111827!important;
  background:#eff6ff!important;
}
.char-counter.warn b{color:#1d4ed8!important}
.char-counter.danger{
  border-color:#111827!important;
  color:#111827!important;
  background:#f8fafc!important;
}
.char-counter.danger b{color:#2563eb!important}
.soft-note{
  color:#111827;
}
#quotaBox{
  border-color:#2563eb!important;
  background:#ffffff!important;
  color:#111827!important;
}
#quotaBox b,#quotaBox strong{color:#2563eb!important}

/* V30 light clean UI */
:root{
  --agi-blue:#2563eb;
  --agi-blue-dark:#1d4ed8;
  --agi-black:#111827;
  --agi-text:#1f2937;
  --agi-muted:#6b7280;
  --agi-border:#dbeafe;
  --agi-bg:#f8fbff;
  --agi-card:#ffffff;
}

html,body{
  background:linear-gradient(180deg,#f8fbff 0%,#eef5ff 100%)!important;
  color:var(--agi-text)!important;
}

.card,.container,.wrap,main{
  background:var(--agi-card)!important;
  color:var(--agi-text)!important;
}

h1,h2,h3,label,.job-title{
  color:var(--agi-black)!important;
}

p,.sub,.note,.job-meta{
  color:var(--agi-muted)!important;
}

textarea,input,select{
  background:#ffffff!important;
  color:var(--agi-black)!important;
  border:1px solid #cbd5e1!important;
}

textarea:focus,input:focus,select:focus{
  border-color:var(--agi-blue)!important;
  outline:none!important;
  box-shadow:0 0 0 3px rgba(37,99,235,.12)!important;
}

button,#createBtn,.smallbtn{
  background:var(--agi-blue)!important;
  color:#fff!important;
  border:none!important;
}

button:hover,#createBtn:hover,.smallbtn:hover{
  background:var(--agi-blue-dark)!important;
}

.ghost{
  background:#eff6ff!important;
  color:var(--agi-blue)!important;
}

.soft-note,#quotaBox,#activeKeyBox{
  background:#ffffff!important;
  color:var(--agi-text)!important;
  border:1px solid var(--agi-border)!important;
  box-shadow:0 8px 22px rgba(37,99,235,.06)!important;
}

#quotaBox{
  color:var(--agi-black)!important;
}

#quotaBox::first-letter{color:var(--agi-blue)}

.char-counter{
  margin-top:10px!important;
  padding:10px 12px!important;
  border:1px solid var(--agi-border)!important;
  background:#ffffff!important;
  border-radius:12px!important;
  color:var(--agi-text)!important;
  font-size:14px!important;
  line-height:1.45!important;
  box-shadow:0 8px 22px rgba(37,99,235,.06)!important;
  display:flex!important;
  gap:10px!important;
  flex-wrap:wrap!important;
  align-items:center!important;
}

.char-counter span{
  display:inline-flex;
  align-items:center;
  gap:4px;
  white-space:nowrap;
}

.char-counter b{
  color:var(--agi-blue)!important;
}

.char-counter.warn{
  border-color:#60a5fa!important;
  background:#eff6ff!important;
}

.char-counter.danger{
  border-color:#2563eb!important;
  background:#f8fbff!important;
  color:var(--agi-black)!important;
}

.char-counter.danger b{
  color:var(--agi-blue-dark)!important;
}

.job,.resource-panel{
  background:#ffffff!important;
  color:var(--agi-text)!important;
  border:1px solid #e5e7eb!important;
}

pre,code,.debug,.result{
  background:#f8fafc!important;
  color:var(--agi-black)!important;
  border:1px solid #e5e7eb!important;
}

.watch-box{
  background:#ffffff!important;
  color:var(--agi-text)!important;
}

.watch-modal{
  background:rgba(15,23,42,.45)!important;
}

@media(max-width:720px){
  .char-counter span{white-space:normal}
}

/* V31 warning text */
.warn-line{
  display:block;
  color:#1d4ed8;
  font-weight:800;
  margin-top:2px;
}
.char-counter.danger .warn-line{
  color:#1d4ed8!important;
}

/* V32 key tab and warning CTA */
.warn-line{
  display:block;
  color:#1d4ed8;
  font-weight:800;
  margin-top:2px;
}
#resource-key{
  border-color:#dbeafe!important;
  background:#ffffff!important;
  color:#111827!important;
}
#resource-key b{color:#1d4ed8!important}
#resource-key p{color:#374151!important}

/* V33 SEO/icon branding */
.badge::before{
  content:"🚀";
  margin-right:6px;
}
