/* AI Assignment Writer - Global Styles */

/* ===== ANIMATED BACKGROUND CANVAS ===== */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ===== CSS VARIABLES ===== */
[data-theme="dark"] {
  --bg: #030308;
  --s1: #08081a;
  --s2: #0e0e24;
  --border: rgba(139, 92, 246, 0.15);
  --accent: #a78bfa;
  --accent2: #c4b5fd;
  --gold: #fbbf24;
  --green: #34d399;
  --red: #f87171;
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted2: #475569;
  --card-bg: rgba(8, 8, 26, 0.7);
  --input-bg: #050514;
  --rc-bg: #08081a;
  --rc-text: #e2e8f0;
  --rc-h1: #f8fafc;
  --rc-h2: #f1f5f9;
  --rc-p: #cbd5e1;
  --glow1: rgba(139, 92, 246, 0.15);
  --glow2: rgba(59, 130, 246, 0.12);
  --glow3: rgba(16, 185, 129, 0.1);
}

[data-theme="light"] {
  --bg: #f8fafc;
  --s1: #ffffff;
  --s2: #f1f5f9;
  --border: rgba(124, 58, 237, 0.12);
  --accent: #7c3aed;
  --accent2: #6d28d9;
  --gold: #d97706;
  --green: #059669;
  --red: #dc2626;
  --text: #0f172a;
  --muted: #64748b;
  --muted2: #94a3b8;
  --card-bg: rgba(255, 255, 255, 0.85);
  --input-bg: #f8fafc;
  --rc-bg: #ffffff;
  --rc-text: #1e293b;
  --rc-h1: #0f172a;
  --rc-h2: #1e293b;
  --rc-p: #334155;
  --glow1: rgba(124, 58, 237, 0.1);
  --glow2: rgba(59, 130, 246, 0.08);
  --glow3: rgba(16, 185, 129, 0.06);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box
}

body {
  background: var(--bg);
  font-family: 'Outfit', sans-serif;
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 70px;
  transition: background .4s, color .4s;
  position: relative;
  background-image: radial-gradient(rgba(139, 92, 246, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMDAiIGhlaWdodD0iMjAwIj48ZmlsdGVyIGlkPSJuIj48ZmVUdXJidWxlbmNlIHR5cGU9ImZyYWN0YWxOb2lzZSIgYmFzZUZyZXF1ZW5jeT0iLjY1IiBudW1PY3RhdmVzPSIzIiBzdGl0Y2hUaWxlcz0ic3RpdGNoIi8+PC9maWx0ZXI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsdGVyPSJ1cmwoI24pIiBvcGFjaXR5PSIuMDUiLz48L3N2Zz4=');
  pointer-events: none;
  z-index: 1;
  opacity: 0.4;
}

/* ===== HEADER ===== */
header {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 28px 20px 22px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, transparent 100%);
}

[data-theme="light"] header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, transparent 100%);
}

header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(139, 92, 246, .18) 0%, transparent 65%),
    radial-gradient(ellipse 40% 40% at 10% 80%, rgba(59, 130, 246, .08) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 90% 70%, rgba(16, 185, 129, .07) 0%, transparent 60%);
  pointer-events: none;
}

header .header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
  z-index: 1;
  width: 100%;
}

/* ===== BADGE ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .35em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, rgba(139, 92, 246, .8), rgba(79, 70, 229, .8));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .25);
  padding: 6px 20px;
  border-radius: 50px;
  margin-bottom: 22px;
  box-shadow: 0 8px 30px rgba(139, 92, 246, .4), inset 0 0 10px rgba(255, 255, 255, .2);
  animation: badgePulse 3s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

.badge::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, .15), transparent);
  transform: rotate(45deg);
  animation: badgeShimmer 4s linear infinite;
}

@keyframes badgeShimmer {
  0% {
    transform: translate(-100%, -100%) rotate(45deg);
  }

  100% {
    transform: translate(100%, 100%) rotate(45deg);
  }
}

@keyframes badgePulse {

  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 8px 30px rgba(139, 92, 246, .4);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 10px 45px rgba(139, 92, 246, .6), 0 0 20px rgba(139, 92, 246, .2);
  }
}

/* ===== LUXURY TITLE ===== */
.luxury-title {
  font-size: clamp(32px, 9vw, 86px);
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  font-style: italic;
  padding: 0 5%;
  letter-spacing: -0.03em;
  line-height: 1.2;
  white-space: nowrap;
  display: block;
  text-align: center;
  margin: 10px 0 0;
  background: linear-gradient(110deg,
      #c084fc 0%, #a78bfa 15%, #818cf8 28%,
      #60a5fa 40%, #34d399 52%, #60a5fa 64%,
      #818cf8 75%, #a78bfa 87%, #c084fc 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: luxuryFlow 6s linear infinite;
  filter: drop-shadow(0 0 40px rgba(139, 92, 246, 0.35)) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
}

[data-theme="light"] .luxury-title {
  background: linear-gradient(110deg,
      #7c3aed 0%, #6d28d9 15%, #4f46e5 28%,
      #2563eb 40%, #059669 52%, #2563eb 64%,
      #4f46e5 75%, #7c3aed 87%, #6d28d9 100%);
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(124, 58, 237, .2));
}

@keyframes luxuryFlow {
  0% {
    background-position: 0% center
  }

  100% {
    background-position: 250% center
  }
}

header p {
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: .06em
}

/* ===== THEME BUTTON ===== */
.theme-btn {
  position: absolute;
  top: 10px;
  right: 0;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 10px 22px;
  cursor: pointer;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  z-index: 10000000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 0 15px rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.theme-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 15px 40px rgba(139, 92, 246, 0.4), 0 0 20px var(--glow1);
}

@media (max-width: 1024px) {
  .theme-btn {
    position: relative;
    top: auto;
    right: auto;
    margin-bottom: 20px;
    transform: none !important;
  }
}

/* ===== MAIN LAYOUT ===== */
main {
  position: relative;
  z-index: 100;
  max-width: 740px;
  margin: 0 auto;
  padding: 20px 18px 20px
}


/* ===== AI BAR ===== */
.ai-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 20px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, .15), inset 0 1px 0 rgba(255, 255, 255, .05);
}

.ai-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green), 0 0 20px rgba(52, 211, 153, .4);
  animation: pulse-dot 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1)
  }

  50% {
    opacity: .5;
    transform: scale(.8)
  }
}

/* ===== SECTION LABELS ===== */
.sec {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 32px 0 16px;
  font-weight: 800;
  font-family: 'Playfair Display', serif;
  font-style: italic;
}

.sec::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* ===== CARDS ===== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 26px;
  margin-bottom: 16px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.card.ov {
  overflow: visible !important;
  z-index: 2000;
}

.card:not(.ov) {
  overflow: hidden;
  z-index: 1;
}


.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

.card:hover {
  border-color: rgba(139, 92, 246, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.card:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15), 0 12px 40px rgba(0, 0, 0, 0.15);
}

.ctitle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 13px;
}

.ctitle i {
  color: var(--accent);
  font-size: 12px;
}

/* ===== FORM INPUTS ===== */
input[type=text],
select,
textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: var(--card-bg);
  box-shadow: 0 0 0 4px var(--glow1), inset 0 2px 4px rgba(0, 0, 0, 0.02);
  transform: translateY(-1px);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted2)
}

textarea {
  resize: vertical;
  line-height: 1.75
}

select option {
  background: var(--card-bg)
}

/* ===== GRID ===== */
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px
}

@media(max-width:500px) {
  .grid2 {
    grid-template-columns: 1fr
  }
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 5px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 14px;
}

.tab-btn {
  flex: 1;
  padding: 9px 6px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  transition: all .2s;
  background: transparent;
  color: var(--muted);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  color: #fff;
  box-shadow: 0 2px 12px rgba(139, 92, 246, .4);
}

/* ===== PILLS ===== */
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px
}

.pill {
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  -webkit-user-select: none;
  user-select: none;
  background: var(--input-bg);
}

.pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--glow1);
}

.pill.active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 20px var(--glow1);
  transform: translateY(-2px) scale(1.02);
}

.pill.gold.active {
  border-color: var(--gold);
  color: #fff;
  background: var(--gold);
  box-shadow: 0 8px 20px rgba(251, 191, 36, 0.3);
}

/* ===== GENERATE BUTTON ===== */
#genBtn,
#qaGenBtn {
  width: 100%;
  padding: 17px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .06em;
  font-family: inherit;
  cursor: pointer;
  transition: all .3s;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  gap: 10px;
  margin-top: 12px;
  position: relative;
  overflow: hidden;
}

#genBtn:not(:disabled),
#qaGenBtn:not(:disabled) {
  background: linear-gradient(135deg, #7c3aed, #4f46e5, #2563eb);
  color: #fff;
  box-shadow: 0 8px 30px rgba(124, 58, 237, .5), 0 0 0 0 rgba(124, 58, 237, .3);
  animation: buttonGlow 3s ease-in-out infinite;
}

@keyframes buttonGlow {

  0%,
  100% {
    box-shadow: 0 8px 30px rgba(124, 58, 237, .5);
  }

  50% {
    box-shadow: 0 8px 40px rgba(124, 58, 237, .7), 0 0 60px rgba(79, 70, 229, .3);
  }
}

/* ===== QUICK ACCESS BAR ===== */
.quick-access-bar {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  z-index: 9999;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-access-bar.hidden {
  opacity: 0 !important;
  visibility: hidden;
  pointer-events: none;
}

.quick-access-bar #qaGenBtn {
  margin-top: 0;
  width: auto;
  padding: 14px 22px;
  box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

@media (max-width: 768px) {
  .quick-access-bar {
    bottom: 20px;
    right: 50%;
    transform: translateX(50%);
    width: calc(100% - 32px);
    max-width: 450px;
    justify-content: space-between;
    padding: 10px 14px;
    gap: 10px;
    border-radius: 100px;
  }

  .quick-access-bar #qaGenBtn {
    padding: 14px 16px;
    font-size: 14px;
    flex: 1;
    border-radius: 100px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .ws-text-desc,
  .qa-toggle-wrap {
    display: none !important;
  }
}

#qaOutlineIconBox {
  display: flex !important;
}

#genBtn::before,
#qaGenBtn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, .1) 0%, transparent 50%);
  pointer-events: none;
}

#genBtn:not(:disabled):hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

#genBtn:disabled {
  background: var(--s2);
  color: var(--muted2);
  cursor: not-allowed;
  box-shadow: none;
  animation: none;
}

/* ===== LOADING ===== */
.loading-box {
  display: none;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 20px;
  background: var(--card-bg);
  border: 1px solid rgba(139, 92, 246, .2);
  border-radius: 14px;
}

.loading-box.show {
  display: flex;
  animation: fadeIn .3s ease;
}

.err-box {
  display: none;
  margin-top: 12px;
  background: rgba(220, 38, 38, .06);
  border: 1px solid rgba(239, 68, 68, .25);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: #f87171;
}

.err-box.show {
  display: block
}

/* ===== RESULT BOX ===== */
#resultBox {
  display: none;
  margin-top: 28px
}

#resultBox.show {
  display: block;
  animation: fadeIn .4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.res-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px
}

.res-hdr-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 20px 0;
}

.res-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--green);
  font-weight: 700;
}

.res-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap
}

/* ===== ACTION BUTTONS ===== */
.copy-btn {
  padding: 9px 15px;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--s2);
  color: var(--muted);
  border: 1px solid var(--border);
  transition: all .2s;
}

.copy-btn.done {
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  color: #fff;
  border-color: transparent;
}

.action-btn {
  padding: 9px 15px;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all .2s;
  color: #fff;
}

.btn-regen {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  box-shadow: 0 3px 14px rgba(124, 58, 237, .3);
}

.btn-humanize {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 3px 14px rgba(37, 99, 235, .3);
}

.btn-plagiarism {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 3px 14px rgba(5, 150, 105, .3);
}

.action-btn:hover,
.size-btn:hover,
.dl-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.action-btn:disabled,
.size-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

/* ===== WORD COUNT BAR ===== */
.wc-bar-wrap {
  margin-top: 12px;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
}

.wc-bar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.wc-bar-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.wc-bar-count {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.wc-bar-bg {
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.wc-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .6s ease, background .4s ease;
}

.wc-bar-fill.ok {
  background: linear-gradient(90deg, #7c3aed, #34d399);
}

.wc-bar-fill.low {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.wc-bar-fill.over {
  background: linear-gradient(90deg, #f87171, #ef4444);
}

.wc-bar-status {
  font-size: 10px;
  margin-top: 6px;
  font-weight: 700;
}

.wc-bar-status.ok {
  color: var(--green);
}

.wc-bar-status.low {
  color: var(--gold);
}

.wc-bar-status.over {
  color: var(--red);
}

/* ===== SIZE STRIP ===== */
.size-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 13px 18px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  flex-wrap: wrap;
}

.size-strip-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.size-btns {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.size-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all .22s;
  color: #fff;
}

.size-btn-shorter {
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: 0 3px 12px rgba(217, 119, 6, .3);
}

.size-btn-longer {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  box-shadow: 0 3px 12px rgba(124, 58, 237, .3);
}

.size-note {
  font-size: 10px;
  color: var(--muted2);
  margin-left: auto;
  white-space: nowrap;
}

@media(max-width:500px) {
  .size-note {
    display: none
  }
}

/* ===== DOWNLOAD BUTTONS ===== */
.dl-btn {
  padding: 9px 16px;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all .2s;
  color: #fff;
}

.dl-pdf {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 3px 14px rgba(220, 38, 38, .3);
}

.dl-doc {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 3px 14px rgba(37, 99, 235, .3);
}

/* ===== RESULT CONTENT ===== */
#resultContent {
  background: var(--rc-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 60px 50px;
  line-height: 1.8;
  font-size: 15px;
  color: var(--rc-text);
  margin-top: 20px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.05);
  position: relative;
}

#resultContent::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  background: linear-gradient(225deg, var(--bg) 50%, rgba(255, 255, 255, 0.05) 50%);
  pointer-events: none;
}

@media(max-width:500px) {
  #resultContent {
    padding: 22px 18px
  }
}

#resultContent.rtl {
  direction: rtl;
  text-align: right;
  font-size: 15px;
  line-height: 2.2
}

#resultContent.rtl h1,
#resultContent.rtl h2,
#resultContent.rtl h3,
#resultContent.rtl h4 {
  text-align: right
}

#resultContent.rtl h2::before,
#resultContent.rtl h3::before {
  content: none
}

#resultContent.rtl ul,
#resultContent.rtl ol {
  padding-right: 22px;
  padding-left: 0
}

textarea.rtl-input {
  direction: rtl;
  text-align: right
}

#resultContent h1 {
  font-size: 26px;
  font-weight: 900;
  color: var(--rc-h1);
  text-align: center;
  margin: 0 0 32px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border);
  letter-spacing: -0.015em;
  line-height: 1.2;
  font-family: 'Playfair Display', serif;
}

#resultContent h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--rc-h2);
  margin: 36px 0 14px;
  padding: 10px 18px;
  background: rgba(139, 92, 246, 0.04);
  border-left: 4px solid var(--accent);
  border-radius: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.3;
}

#resultContent h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--rc-h2);
  margin: 24px 0 10px;
  padding-left: 14px;
  border-left: 2px solid var(--accent);
  line-height: 1.4;
}

#resultContent h4 {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  margin: 16px 0 6px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

#resultContent p {
  margin-bottom: 14px;
  color: var(--rc-p);
  line-height: 1.9;
  text-align: justify;
}

#resultContent ul,
#resultContent ol {
  padding-left: 22px;
  margin: 4px 0 14px;
}

#resultContent ul {
  list-style: none;
  padding-left: 0
}

#resultContent ul li {
  margin-bottom: 8px;
  color: var(--rc-p);
  line-height: 1.75;
  padding-left: 22px;
  position: relative;
}

#resultContent ul li::before {
  content: "\25B8";
  position: absolute;
  left: 0;
  top: 1px;
  color: var(--accent);
  font-size: 12px;
}

#resultContent ol li {
  margin-bottom: 8px;
  color: var(--rc-p);
  line-height: 1.75;
  padding-left: 4px;
}

#resultContent strong {
  color: var(--rc-h1);
  font-weight: 700
}

#resultContent em {
  color: var(--gold);
  font-style: italic
}

#resultContent blockquote {
  margin: 14px 0;
  padding: 14px 20px;
  border-left: 3px solid var(--accent);
  background: rgba(139, 92, 246, .06);
  border-radius: 0 10px 10px 0;
}

#resultContent blockquote p {
  margin-bottom: 0;
  color: var(--accent2)
}

#resultContent hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 22px 0;
}

.wc-note {
  font-size: 10px;
  color: var(--muted2);
  margin-top: 6px;
  text-align: right
}

.char-counter {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 700;
  color: var(--muted2);
  transition: color .2s;
}

.char-counter.warn {
  color: var(--gold);
}

.char-counter.danger {
  color: var(--red);
}

.char-counter .char-num {
  font-weight: 800;
  font-size: 11px;
}

.model-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--muted);
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--s2);
}

/* ===== HISTORY ===== */
.hist-item {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 15px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hist-item:hover {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--glow1);
}

.hist-topic {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hist-meta {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}

.hist-del {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  transition: color .2s;
  flex-shrink: 0;
}

.hist-del:hover {
  color: var(--red);
}

.hist-empty {
  text-align: center;
  color: var(--muted2);
  font-size: 13px;
  padding: 20px;
}

.tmpl-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

/* ===== MODALS ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .85);
  z-index: 11000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.modal-overlay.show {
  display: flex;
  animation: fadeIn .3s ease;
}

.modal {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 22px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 255, 255, .03);
}

.modal-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
}

.modal-close {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 7px 13px;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-family: inherit;
  transition: all .2s;
}

.modal-close:hover {
  border-color: var(--red);
  color: var(--red);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 13px;
  margin-bottom: 16px;
}

.toggle-label-main {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.toggle-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.toggle {
  position: relative;
  width: 44px;
  height: 25px;
  flex-shrink: 0;
}

.toggle input {
  display: none
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 99px;
  cursor: pointer;
  transition: .3s;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  transition: .3s;
}

.toggle input:checked+.toggle-slider {
  background: linear-gradient(135deg, var(--accent), #6d28d9);
}

.toggle input:checked+.toggle-slider::before {
  transform: translateX(19px);
}

.form-section {
  display: none
}

.form-section.show {
  display: block
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

@media(max-width:480px) {
  .form-grid {
    grid-template-columns: 1fr
  }
}

.form-group label {
  display: block;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 700;
}

.form-group input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 13px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

.form-group input:focus {
  border-color: rgba(139, 92, 246, .5);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .08);
}

.font-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.font-opt {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
  background: var(--input-bg);
}

.font-opt:hover {
  border-color: var(--accent);
}

.font-opt.active {
  border-color: var(--accent);
  background: rgba(139, 92, 246, .08);
  box-shadow: 0 0 12px rgba(139, 92, 246, .1);
}

.font-opt .fname {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.font-opt .fsample {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}

.tmpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.tmpl-opt {
  border: 2px solid var(--border);
  border-radius: 11px;
  cursor: pointer;
  transition: all .2s;
  overflow: hidden;
  background: var(--input-bg);
}

.tmpl-opt:hover {
  border-color: var(--accent);
}

.tmpl-opt.active {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(139, 92, 246, .2);
}

.tmpl-preview {
  height: 78px;
  padding: 7px;
  overflow: hidden
}

.tmpl-name {
  font-size: 9px;
  color: var(--muted);
  text-align: center;
  padding: 5px;
  border-top: 1px solid var(--border);
  font-weight: 700;
  letter-spacing: .03em
}

.tmpl-opt.active .tmpl-name {
  color: var(--accent2)
}

.p-line {
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  margin-bottom: 3px
}

.p-line.bl {
  background: var(--accent);
  opacity: .5
}

.modal-btns {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap
}

.skip-btn {
  flex: 1;
  min-width: 120px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.skip-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.dl-final-btn {
  flex: 2;
  min-width: 150px;
  padding: 13px;
  border: none;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .2s;
  color: #fff;
}

.dl-final-pdf {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 4px 18px rgba(220, 38, 38, .35);
}

.dl-final-doc {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 4px 18px rgba(37, 99, 235, .35);
}

.dl-final-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.heart {
  display: inline-block;
  animation: heartbeat 1.4s ease-in-out infinite
}

@keyframes heartbeat {

  0%,
  100% {
    transform: scale(1)
  }

  14% {
    transform: scale(1.35)
  }

  28% {
    transform: scale(1)
  }

  42% {
    transform: scale(1.2)
  }

  70% {
    transform: scale(1)
  }
}

.heart-inner {
  background: linear-gradient(135deg, #f43f5e, #ec4899, #a855f7, #f43f5e);
  background-size: 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 20px;
  animation: hshift 3s linear infinite
}

@keyframes hshift {
  0% {
    background-position: 0%
  }

  100% {
    background-position: 200%
  }
}

.ali-name {
  animation: shimmer 2.8s ease infinite, glow 2.8s ease-in-out infinite;
  background: linear-gradient(90deg, #c084fc, #818cf8, #60a5fa, #34d399, #60a5fa, #818cf8, #c084fc);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: .1em
}

@keyframes shimmer {
  0% {
    background-position: 0% 50%
  }

  50% {
    background-position: 100% 50%
  }

  100% {
    background-position: 0% 50%
  }
}

@keyframes glow {

  0%,
  100% {
    filter: drop-shadow(0 0 6px rgba(192, 132, 252, .4))
  }

  50% {
    filter: drop-shadow(0 0 14px rgba(129, 140, 248, .8))
  }
}

footer {
  text-align: center;
  margin-top: 40px;
  padding: 30px 20px;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 5;
  background: #00000000;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.footer-tag {
  font-size: 9px;
  font-weight: 800;
  color: var(--muted2);
  letter-spacing: .3em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: block;
}

.footer-built {
  font-size: 15px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.by-text {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: .02em;
}

.ali-name {
  display: inline-block;
  font-weight: 900;
  font-size: 19px;
  letter-spacing: .08em;
  background: linear-gradient(90deg, #c084fc, #818cf8, #60a5fa, #34d399, #60a5fa, #818cf8, #c084fc);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 2.8s ease infinite, glow 2.8s ease-in-out infinite;
  text-shadow: 0 0 30px rgba(139, 92, 246, 0.1);
}

.heart-mini {
  color: #ef4444;
  font-size: 12px;
  animation: heartbeat 1.5s ease-in-out infinite;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 15px auto 0;
  width: 100%;
  max-width: 300px;
  flex-wrap: wrap;
}

.f-link {
  font-size: 17px;
  color: var(--text);
  text-decoration: none;
  transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.f-link:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 25px var(--glow1);
}

.f-link i {
  font-size: 14px;
  transition: transform .3s ease;
}

.f-link:hover i {
  transform: scale(1.2) rotate(5deg);
}

.f-sep {
  display: none;
}

.req-star {
  display: inline-block;
  color: #f87171;
  font-size: 11px;
  margin-left: 4px;
  animation: starPulse 1.5s ease-in-out infinite
}

@keyframes starPulse {

  0%,
  100% {
    color: #f87171;
    transform: scale(1)
  }

  50% {
    color: #fca5a5;
    transform: scale(1.3)
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 28px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
  z-index: 100000;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 12px;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Message Types */
.toast.green {
  border-color: rgba(52, 211, 153, 0.5);
  color: #10b981;
  box-shadow: 0 10px 40px rgba(16, 185, 129, 0.15);
}

.toast.red {
  border-color: rgba(248, 113, 113, 0.5);
  color: #ef4444;
  box-shadow: 0 10px 40px rgba(239, 68, 68, 0.15);
}

.toast.orange {
  border-color: rgba(251, 191, 36, 0.5);
  color: #f59e0b;
  box-shadow: 0 10px 40px rgba(245, 158, 11, 0.15);
}

.toast.blue {
  border-color: rgba(96, 165, 250, 0.5);
  color: #3b82f6;
  box-shadow: 0 10px 40px rgba(59, 130, 246, 0.15);
}

.toast.purple {
  border-color: rgba(167, 139, 250, 0.5);
  color: #8b5cf6;
  box-shadow: 0 10px 40px rgba(139, 92, 246, 0.15);
}

.toast i {
  font-size: 16px;
}

@media (max-width: 768px) {
  .toast {
    bottom: auto;
    top: 24px;
    transform: translateX(-50%) translateY(-80px);
    padding: 12px 20px;
    font-size: 13px;
    width: 90%;
    max-width: 380px;
    justify-content: center;
  }

  .toast.show {
    transform: translateX(-50%) translateY(0);
  }
}



/* ===== WEB SEARCH TOGGLE BOX ===== */
#webSearchToggleBox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 22px;
  margin-bottom: 12px;
  transition: all .3s;
}

/* ===== STATS BAR ===== */
.stats-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 10px;
  padding: 10px 18px;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 12px;
  flex-wrap: wrap;
}

.stat-item {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.stat-item i {
  color: var(--accent);
  font-size: 10px;
}

.stat-item span {
  color: var(--text);
}

/* ===== ORIGINALITY SCORE ===== */
.orig-score {
  display: none;
  margin-top: 10px;
  background: rgba(52, 211, 153, .06);
  border: 1px solid rgba(52, 211, 153, .25);
  border-radius: 14px;
  padding: 14px 20px;
  animation: fadeIn .4s ease;
}

.orig-score.show {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.orig-ring {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0%, var(--green) var(--pct, 97%), var(--border) var(--pct, 97%));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.orig-ring::before {
  content: '';
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--rc-bg);
}

.orig-pct {
  font-size: 13px;
  font-weight: 800;
  color: var(--green);
  position: relative;
  z-index: 1;
}

.orig-text .orig-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
}

.orig-text .orig-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* ===== RETRY BOX ===== */
.retry-box {
  display: none;
  margin-top: 8px;
}

.retry-btn {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(248, 113, 113, .4);
  border-radius: 10px;
  background: rgba(248, 113, 113, .06);
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all .2s;
}

.retry-btn:hover {
  background: rgba(248, 113, 113, .12);
  border-color: var(--red);
}

/* ===== CLEAR ALL BUTTON ===== */
.clear-btn {
  width: 100%;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all .2s;
  margin-bottom: 10px;
  margin-top: 10px;
}

.clear-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ===== STREAMING CURSOR ===== */
.stream-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  animation: blink .7s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: 0
  }
}

/* ===== FLOATING GENERATE BUTTON ===== */
/* ===== FLOATING ACTION DOCK ===== */
.bottom-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  width: auto;
  max-width: 94%;
  min-width: 320px;
  height: 72px;
  background: rgba(20, 20, 40, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 100px;
  -webkit-backdrop-filter: blur(30px);
  backdrop-filter: blur(30px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 24px;
  z-index: 20000000;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  gap: 20px;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s;
  opacity: 0;
  pointer-events: none;
}

[data-theme="light"] .bottom-bar {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

.bottom-bar.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: all;
}

@media (min-width: 1024px) {
  .bottom-bar {
    left: auto;
    right: 32px;
    transform: translateY(100px);
    min-width: 460px;
  }

  .bottom-bar.show {
    transform: translateY(0);
  }
}

@keyframes barSlideIn {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.bb-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

.bb-toggle-wrap i {
  color: var(--accent);
  font-size: 16px;
}

.bb-write-btn {
  flex: 1;
  max-width: 320px;
  height: 48px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5, #2563eb);
  background-size: 200% auto;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(124, 58, 237, 0.3);
  animation: btnGradient 4s linear infinite;
  transition: all 0.3s;
}

.bb-write-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(124, 58, 237, 0.45);
}

@keyframes btnGradient {
  0% {
    background-position: 0% 50%
  }

  50% {
    background-position: 100% 50%
  }

  100% {
    background-position: 0% 50%
  }
}

#floatGenBtn.visible {
  display: flex;
  animation: floatIn .5s cubic-bezier(.34, 1.56, .64, 1), floatMotion 4s ease-in-out infinite, btnGradient 6s linear infinite;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(100px) scale(.5) rotate(-10deg);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0);
  }
}

#floatGenBtn:hover {
  transform: translateY(-3px) scale(1.04);
  filter: brightness(1.12);
}

#floatGenBtn:disabled {
  opacity: .55;
  cursor: not-allowed;
  animation: none;
}

/* ===== TOPIC SUGGESTIONS ===== */
.topic-wrap {
  position: relative;
  z-index: 1100;
}

#topicSuggestions {
  display: none;
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0;
  right: 0;
  z-index: 99999;
  background: var(--s1) !important;
  border: 2px solid var(--accent);
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 0 20px rgba(139, 92, 246, 0.1);
  max-height: 300px;
  overflow-y: auto;
  opacity: 1 !important;
}



#topicSuggestions.open {
  display: block;
  animation: dropdownSlideIn 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

@keyframes dropdownSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.sugg-header {
  padding: 8px 14px 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.sugg-item {
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  transition: all .2s;
  border-bottom: 1px solid rgba(139, 92, 246, .05);
  animation: itemPopIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

.sugg-item:nth-child(1) {
  animation-delay: 0.05s;
}

.sugg-item:nth-child(2) {
  animation-delay: 0.10s;
}

.sugg-item:nth-child(3) {
  animation-delay: 0.15s;
}

.sugg-item:nth-child(4) {
  animation-delay: 0.20s;
}

.sugg-item:nth-child(5) {
  animation-delay: 0.25s;
}

.sugg-item:nth-child(6) {
  animation-delay: 0.30s;
}

.sugg-item:nth-child(7) {
  animation-delay: 0.35s;
}

@keyframes itemPopIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(5px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}


.sugg-item:last-child {
  border-bottom: none;
}

.sugg-item:hover,
.sugg-item.highlighted {
  background: rgba(139, 92, 246, .1);
  color: var(--accent);
}

.sugg-item i {
  color: var(--accent);
  font-size: 11px;
  flex-shrink: 0;
}

/* ===== READABILITY METER ===== */
#readMeter {
  display: none;
  margin-top: 15px;
  padding: 16px 22px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  animation: fadeIn 0.4s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
}

#readMeter.show {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.read-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.read-bar-wrap {
  flex: 1;
  min-width: 120px;
}

.read-bar-bg {
  height: 7px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 5px;
}

.read-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .7s ease, background .5s ease;
}

.read-level {
  font-size: 12px;
  font-weight: 800;
}

.read-level.easy {
  color: #34d399;
}

.read-level.medium {
  color: #fbbf24;
}

.read-level.hard {
  color: #f87171;
}

.read-bar-fill.easy {
  background: linear-gradient(90deg, #059669, #34d399);
  width: 30%;
}

.read-bar-fill.medium {
  background: linear-gradient(90deg, #d97706, #fbbf24);
  width: 65%;
}

.read-bar-fill.hard {
  background: linear-gradient(90deg, #dc2626, #f87171);
  width: 100%;
}

.read-detail {
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
}

/* ===== CUSTOM WC INPUT ===== */
#customWcWrap {
  display: none;
  margin-top: 10px;
}

#customWcWrap.show {
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn .2s ease;
}

#customWcInput {
  width: 110px;
  padding: 8px 12px;
  border: 1px solid rgba(139, 92, 246, .4);
  border-radius: 9px;
  background: var(--input-bg);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}

#customWcInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .1);
}

.custom-wc-apply {
  padding: 8px 14px;
  border: none;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s;
}

.custom-wc-apply:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* ===== READING TIME ===== */
#readingTime {
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ===== PROGRESS STEPS ===== */
.progress-steps {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
}

.prog-step {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted2);
  transition: color .4s;
  white-space: nowrap;
}

.prog-step.active {
  color: var(--accent);
}

.prog-step.done {
  color: var(--green);
}

.prog-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  transition: all .4s;
  flex-shrink: 0;
}

.prog-step.active .prog-dot {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(139, 92, 246, .5);
  animation: pulse-dot 1s ease-in-out infinite;
}

.prog-step.done .prog-dot {
  background: var(--green);
}

.prog-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 4px;
  transition: background .4s;
  min-width: 14px;
}

.prog-line.done {
  background: var(--green);
}

/* ===== RESULT ACTIONS ===== */
.res-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.action-btn,
.copy-btn,
.dl-btn {
  font-size: 10px;
  padding: 6px 12px;
  border-radius: 8px;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all .2s;
}

@media(max-width:640px) {
  .res-actions {
    gap: 4px;
    justify-content: center;
  }

  .action-btn,
  .copy-btn,
  .dl-btn {
    padding: 5px 9px;
    font-size: 9.5px;
    height: 30px;
  }
}

/* ===== TEXT-TO-SPEECH ===== */
.btn-tts {
  background: linear-gradient(135deg, #0891b2, #0e7490);
  box-shadow: 0 3px 14px rgba(8, 145, 178, .3);
}

.btn-tts.speaking {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 3px 14px rgba(220, 38, 38, .35);
  animation: pulse-btn 1.2s ease-in-out infinite;
}

@keyframes pulse-btn {

  0%,
  100% {
    filter: brightness(1)
  }

  50% {
    filter: brightness(1.2)
  }
}

/* ===== A/B VERSION ===== */
.btn-abver {
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  box-shadow: 0 3px 14px rgba(124, 58, 237, .3);
}

.ab-panel {
  display: none;
  margin-top: 14px;
  border: 1px solid rgba(139, 92, 246, .3);
  border-radius: 15px;
  overflow: hidden;
  animation: fadeIn .4s ease;
}

.ab-panel.show {
  display: block;
}

.ab-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.ab-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
  transition: all .2s;
  border: none;
  background: transparent;
  font-family: inherit;
}

.ab-tab.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  background: rgba(139, 92, 246, .05);
}

.ab-content {
  padding: 22px 26px;
  background: var(--rc-bg);
  font-size: 14px;
  line-height: 1.9;
  color: var(--rc-text);
}

@media(max-width:500px) {
  .ab-content {
    padding: 16px 14px;
  }
}

/* ===== INLINE EDIT ===== */
.btn-edit {
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: 0 3px 14px rgba(217, 119, 6, .3);
}

.btn-edit.editing {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 3px 14px rgba(5, 150, 105, .35);
}

#resultContent[contenteditable=true] {
  border: 2px dashed rgba(139, 92, 246, .45) !important;
  outline: none;
  cursor: text;
  padding: 34px 36px;
}

#resultContent[contenteditable=true]:focus {
  border-color: rgba(139, 92, 246, .7) !important;
}

.edit-save-bar {
  display: none;
  margin-top: 8px;
  padding: 10px 16px;
  background: rgba(5, 150, 105, .08);
  border: 1px solid rgba(5, 150, 105, .25);
  border-radius: 11px;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.edit-save-bar.show {
  display: flex;
  animation: fadeIn .25s ease;
}

.save-edits-btn {
  padding: 9px 18px;
  border: none;
  border-radius: 9px;
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.discard-edits-btn {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

/* ===== GRADER CARD ===== */
.grade-card {
  display: none;
  margin-top: 15px;
  padding: 22px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  animation: fadeIn 0.5s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  position: relative;
}

.grade-card.show {
  display: block;
}

.grade-title {
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.02em;
}

.grade-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.grade-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  width: 90px;
  flex-shrink: 0;
}

.grade-bar-bg {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.grade-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), #34d399);
  transition: width .8s ease;
}

.grade-score {
  font-size: 11px;
  font-weight: 800;
  color: var(--text);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

.grade-total {
  font-size: 13px;
  font-weight: 800;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.grade-feedback {
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.6;
}

/* ===== WRITING STYLE ANALYZER ===== */
#styleHint {
  display: none;
  margin-top: 8px;
  padding: 9px 14px;
  border-radius: 10px;
  background: rgba(139, 92, 246, .07);
  border: 1px solid rgba(139, 92, 246, .2);
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  align-items: center;
  gap: 8px;
  animation: fadeIn .25s ease;
}

#styleHint.show {
  display: flex;
}

/* ===== SECTION COPY BUTTONS ===== */
.section-hdr {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
}

.section-hdr h2 {
  flex: 1;
  margin: 0;
}

.sec-copy-btn {
  display: none;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px 10px;
  border: 1px solid rgba(139, 92, 246, .3);
  border-radius: 7px;
  background: var(--card-bg);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: all .2s;
  z-index: 2;
}

.section-hdr:hover .sec-copy-btn {
  display: flex;
}

.sec-copy-btn:hover {
  background: rgba(139, 92, 246, .15);
}

/* ===== PARAGRAPH REWRITE TOOLBAR ===== */
.para-wrap {
  position: relative;
}

#paraToolbar {
  display: none;
  position: absolute;
  z-index: 9999;
  background: var(--card-bg);
  border: 1px solid rgba(139, 92, 246, .35);
  border-radius: 10px;
  padding: 5px 6px;
  box-shadow: 0 8px 35px rgba(0, 0, 0, .3);
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  pointer-events: auto;
  animation: fadeIn .2s ease;
}

#paraToolbar.show {
  display: flex;
}

.para-tool-btn {
  padding: 6px 11px;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: filter .2s;
}

.para-tool-btn:hover {
  filter: brightness(1.15);
}

.ptb-rw {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.ptb-exp {
  background: linear-gradient(135deg, #059669, #047857);
}

.ptb-sh {
  background: linear-gradient(135deg, #d97706, #b45309);
}

.ptb-close {
  background: var(--s2);
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 6px 8px;
}

.btn-history {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 18px;
  cursor: pointer;
  font-family: inherit;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.btn-history::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), transparent);
  opacity: 0;
  transition: opacity .3s;
}

.btn-history:hover {
  color: #fff;
  border-color: rgba(139, 92, 246, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.25);
}

.btn-history:hover::before {
  opacity: 1;
}

.btn-history i {
  font-size: 14px;
  color: var(--accent);
  transition: transform .4s ease;
}

.btn-history:hover i {
  transform: rotate(-15deg) scale(1.1);
}

/* ===== ENTRANCE ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.delay-1 {
  animation-delay: 0.1s;
}

.delay-2 {
  animation-delay: 0.2s;
}

.delay-3 {
  animation-delay: 0.3s;
}

.delay-4 {
  animation-delay: 0.4s;
}

/* ===== SIMPLE DOCUMENT FONT FOR RESULT ===== */
#resultContent {
  font-family: 'Georgia', 'Times New Roman', Times, serif !important;
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--rc-text);
}

#resultContent h1 {
  font-family: 'Outfit', sans-serif !important;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  margin: 0 0 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

#resultContent h2 {
  font-family: 'Outfit', sans-serif !important;
  font-size: 16px;
  font-weight: 700;
  margin: 22px 0 8px;
  color: var(--text);
}

#resultContent h3 {
  font-family: 'Outfit', sans-serif !important;
  font-size: 14px;
  font-weight: 600;
  margin: 14px 0 6px;
}

#resultContent p {
  margin: 0 0 12px;
  text-align: justify;
}

#resultContent ul,
#resultContent ol {
  margin: 6px 0 12px 22px;
}

#resultContent li {
  margin-bottom: 4px;
}

#resultContent blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  margin: 10px 0;
  font-style: italic;
  color: var(--muted);
}

/* ===== GROUPED ACTION BUTTONS ===== */
.res-action-groups {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}

.action-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.action-group-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted2);
  min-width: 68px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.action-group-label i {
  font-size: 9px;
}

.action-group-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 2px 0;
  opacity: .6;
}

.ag-tts-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

#voiceSelectWrap {
  display: flex !important;
  align-items: center;
  gap: 5px;
}

#voiceSelectWrap.show {
  display: flex !important;
}

#editModal {
  z-index: 999999;
}

.edit-modal-inner {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: min(92vw, 860px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 100px rgba(0, 0, 0, .5);
  animation: fadeIn .3s ease;
  overflow: hidden;
}

.edit-modal-hdr {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--s1);
  flex-shrink: 0;
}

.edit-modal-toolbar {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--s2);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.edit-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 28px 36px;
  font-family: 'Georgia', 'Times New Roman', Times, serif;
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--rc-text);
  outline: none;
  min-height: 200px;
}

.edit-modal-body:focus {
  outline: none;
}

.edit-modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--s1);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.edit-wc-info {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.edit-save-btn {
  padding: 10px 24px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
}

.edit-discard-btn {
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

@media(max-width:500px) {
  .edit-modal-body {
    padding: 18px 16px;
  }
}

/* ===== OUTLINE CONFIRMATION MODAL ===== */
#outlineConfirmModal {
  z-index: 1050;
}

.outline-confirm-inner {
  background: var(--card-bg);
  border-radius: 20px;
  width: min(92vw, 780px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 100px rgba(0, 0, 0, .45);
  animation: fadeIn .35s ease;
  overflow: hidden;
}

.oc-hdr {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, rgba(124, 58, 237, .08), rgba(79, 70, 229, .05));
}

.oc-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 26px;
}

.oc-editor {
  width: 100%;
  min-height: 220px;
  max-height: 42vh;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  line-height: 1.8;
  padding: 16px 18px;
  resize: vertical;
  outline: none;
  transition: border-color .2s;
}

.oc-editor:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .1);
}

.oc-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--s1);
  flex-shrink: 0;
}

.oc-confirm-btn {
  flex: 2;
  min-width: 200px;
  padding: 13px 20px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(124, 58, 237, .35);
  transition: transform .15s, box-shadow .15s;
}

.oc-confirm-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(124, 58, 237, .45);
}

.oc-regen-btn {
  flex: 1;
  min-width: 120px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.oc-skip-btn {
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.oc-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(124, 58, 237, .12);
  color: var(--accent);
  border: 1px solid rgba(124, 58, 237, .25);
}

@media(max-width:500px) {
  .oc-body {
    padding: 14px 16px;
  }

  .oc-footer {
    padding: 12px 16px;
  }
}

#richToolbar {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  background: var(--s1);
  border: 2px solid var(--accent);
  border-radius: 14px;
  margin-bottom: 10px;
  animation: fadeIn .25s ease;
  box-shadow: 0 4px 24px rgba(124, 58, 237, .18);
}

#richToolbar.show {
  display: flex;
}

.rt-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all .15s;
  font-family: inherit;
}

.rt-btn:hover,
.rt-btn.rt-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.rt-sep {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 3px;
  flex-shrink: 0;
}

.rt-select {
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--input-bg);
  color: var(--text);
  font-size: 11px;
  font-family: inherit;
  padding: 0 6px;
  cursor: pointer;
  outline: none;
}

.rt-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: .08em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.rt-save {
  height: 30px;
  border: none;
  border-radius: 7px;
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  padding: 0 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.rt-discard {
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  padding: 0 12px;
  cursor: pointer;
}

/* ===== FONT SIZE STRIP ===== */
.font-size-strip {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 14px;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 11px;
  color: var(--muted);
}

.font-size-strip.show {
  display: flex;
  animation: fadeIn .3s ease;
}

#fontSizeSlider {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  width: 110px;
  cursor: pointer;
}

#fontSizeSlider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

/* ===== UNDO / REDO ===== */
.btn-undo,
.btn-redo {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .15);
}

.btn-undo:disabled,
.btn-redo:disabled {
  opacity: .35 !important;
  cursor: not-allowed;
}

/* ===== OUTLINE PANEL ===== */
.outline-panel {
  display: none;
  margin-top: 14px;
  border: 1px solid rgba(124, 58, 237, .3);
  border-radius: 16px;
  overflow: hidden;
  animation: fadeIn .4s ease;
  background: var(--card-bg);
}

.outline-panel.show {
  display: block;
}

.outline-hdr {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.outline-hdr-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.outline-body {
  padding: 16px 20px;
  font-size: 13px;
  line-height: 2;
  color: var(--rc-text);
  max-height: 320px;
  overflow-y: auto;
}

.outline-footer {
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ===== KEYWORD HIGHLIGHT ===== */
.kw-highlight {
  background: rgba(251, 191, 36, .28);
  border-radius: 3px;
  padding: 0 2px;
  border-bottom: 2px solid var(--gold);
}

/* ===== FAVORITE STAR ===== */
.fav-star-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted2);
  font-size: 17px;
  transition: all .2s;
  padding: 2px 4px;
  line-height: 1;
}

.fav-star-btn:hover,
.fav-star-btn.fav-active {
  color: var(--gold);
  transform: scale(1.25);
}

/* ===== SESSION TIMER ===== */
.stat-timer {
  font-size: 10px;
  color: var(--muted2);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

/* ===== VOICE SELECT ===== */
#voiceSelectWrap {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  animation: fadeIn .25s ease;
}

#voiceSelectWrap.show {
  display: flex;
}

#voiceSelect {
  height: 27px;
  font-size: 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  padding: 0 7px;
  font-family: inherit;
  outline: none;
}

/* ===== HISTORY PREVIEW MODAL ===== */
#histPreviewModal .modal {
  max-width: 700px;
}

.hist-preview-content {
  background: var(--rc-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px 28px;
  font-size: 14px;
  line-height: 1.85;
  color: var(--rc-text);
  max-height: 55vh;
  overflow-y: auto;
  margin: 16px 0;
}

@media(max-width:500px) {
  .hist-preview-content {
    padding: 14px 16px;
  }
}

/* ===== GEN TIME BADGE ===== */
.gen-time-badge {
  font-size: 9px;
  font-weight: 700;
  color: var(--green);
  background: rgba(52, 211, 153, .1);
  border: 1px solid rgba(52, 211, 153, .25);
  border-radius: 99px;
  padding: 2px 9px;
  letter-spacing: .05em;
}

/* ===== QA WEB SEARCH INLINE REPLACEMENTS ===== */
.qa-web-search-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: none;
  padding: 0;
  transition: all .3s;
  gap: 10px;
}

.qa-ws-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qa-ws-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--s2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .3s;
  cursor: pointer;
}

.qa-ws-icon {
  font-size: 14px;
  color: var(--muted);
}

.qa-ws-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.qa-ws-status {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
}

.qa-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qa-ws-badge {
  display: none;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #10b981;
  background: rgba(16, 185, 129, .1);
  border: 1px solid rgba(16, 185, 129, .3);
  border-radius: 99px;
  padding: 2px 8px;
}

.qa-toggle-label {
  margin: 0;
}

/* ===== UTILITY CLASSES (MIGRATED FROM INLINE STYLES) ===== */
.flex-row { display: flex; align-items: center; }
.flex-row-center { display: flex; align-items: center; justify-content: center; }
.flex-row-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.ml-auto { margin-left: auto; }
.mt-2 { margin-top: 2px; }
.mt-5 { margin-top: 5px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mb-8 { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-12 { margin-bottom: 12px; }
.w-full { width: 100%; }
.m-0 { margin: 0; }
.no-resize { resize: none; }
.v-resize { resize: vertical; }

/* Font Utilities */
.text-xs { font-size: 9px; }
.text-sm { font-size: 11px; }
.text-base { font-size: 13px; }
.text-lg { font-size: 15px; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 800; }
.font-heavy { font-weight: 900; }
.tracking-tight { letter-spacing: -0.015em; }
.tracking-wide { letter-spacing: .06em; }
.uppercase { text-transform: uppercase; }
.italic { font-style: italic; }

/* Colors */
.text-green { color: var(--green); }
.text-gold { color: var(--gold); }
.text-muted { color: var(--muted); }
.text-muted2 { color: var(--muted2); }
.text-accent { color: var(--accent); }

/* Specific Components */
.badge-live {
  font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: #10b981; background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3);
  border-radius: 99px; padding: 2px 8px;
}

.badge-strict {
  font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: #f59e0b; background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.35);
  border-radius: 99px; padding: 2px 8px;
}

.badge-on {
  font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent); background: rgba(124,58,237,.1); border: 1px solid rgba(124,58,237,.35);
  border-radius: 99px; padding: 3px 10px;
}

.model-pill-mini {
  display: flex; align-items: center; gap: 8px; background: rgba(16,185,129,.08);
  border: 1px solid rgba(16,185,129,.2); border-radius: 99px; padding: 5px 14px;
}

.model-icon-box-mini {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(135deg,#0a1f0a,#051205);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #4ade80;
}

.icon-box-sq {
  width: 36px; height: 36px; border-radius: 10px; background: var(--s2);
  border: 1px solid var(--border); display: flex; align-items: center;
  justify-content: center; transition: all .3s;
}

.icon-box-sq-lg {
  width: 38px; height: 38px; border-radius: 11px; background: var(--s2);
  border: 1px solid var(--border); display: flex; align-items: center;
  justify-content: center; font-size: 18px; transition: all .3s; flex-shrink: 0;
}

.optional-text { color: var(--muted2); margin-left: 5px; font-weight: 400; font-size: 11px; }

.strict-info-box {
  margin-top: 14px; padding: 12px 14px; background: rgba(245,158,11,.06);
  border: 1px solid rgba(245,158,11,.2); border-radius: 10px;
}

.ai-status-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 20px; margin-bottom: 10px; transition: all .3s; flex-wrap: wrap; gap: 10px;
}

/* More Layouts */
.flex-row-gap-8 { display: flex; align-items: center; gap: 8px; }
.flex-row-gap-10 { display: flex; align-items: center; gap: 10px; }
.flex-row-gap-12 { display: flex; align-items: center; gap: 12px; }
.flex-col-gap-10 { display: flex; flex-direction: column; gap: 10px; }
.justify-center { justify-content: center; }
.items-center { align-items: center; }

/* Gradients */
.bg-gradient-orange { background: linear-gradient(135deg, #d97706, #b45309); box-shadow: 0 3px 14px rgba(217, 119, 6, .25); }
.bg-gradient-purple { background: linear-gradient(135deg, #7c3aed, #4f46e5); box-shadow: 0 3px 14px rgba(124, 58, 237, .25); }
.bg-gradient-blue { background: linear-gradient(135deg, #0891b2, #0e7490); box-shadow: 0 3px 14px rgba(8, 145, 178, .25); }
.bg-gradient-green { background: linear-gradient(135deg, #25D366, #128C7E); box-shadow: 0 3px 14px rgba(37, 211, 102, .25); }
.bg-gradient-indigo { background: linear-gradient(135deg, #6366f1, #4f46e5); box-shadow: 0 3px 14px rgba(99, 102, 241, .25); }

/* Elements */
.loading-box-mini { display: flex; flex-direction: column; gap: 10px; }
.spinner-icon {
  width: 18px; height: 18px; border: 2px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin .7s linear infinite; flex-shrink: 0;
}
.safe-area-bottom { height: 100px; }
.input-group-row {
  display: flex; align-items: center; gap: 8px; background: var(--input-bg);
  border: 1px solid var(--border); border-radius: 9px; padding: 10px 13px;
}
.no-border-btn { background: transparent; border: none; color: var(--muted); cursor: pointer; font-family: inherit; }

/* Visibility & States */
.hidden { display: none !important; }
.display-none { display: none !important; }

/* Dynamic States (replacing JS inline styles) */
.active-ws-box { border-color: rgba(16,185,129,.4) !important; background: rgba(16,185,129,.04) !important; }
.active-ws-icon-box { background: rgba(16,185,129,.15) !important; border-color: rgba(16,185,129,.4) !important; }
.active-ws-icon { color: #10b981 !important; }
.active-ws-text { color: #10b981 !important; }

.active-childish-box { border-color: rgba(245,158,11,.5) !important; background: rgba(245,158,11,.03) !important; }
.active-childish-icon-box { background: rgba(245,158,11,.15) !important; border-color: rgba(245,158,11,.4) !important; }
.active-childish-text { color: var(--gold) !important; }

.active-outline-box { border-color: rgba(124,58,237,.5) !important; background: rgba(124,58,237,.03) !important; }
.active-outline-icon-box { background: rgba(124,58,237,.15) !important; border-color: rgba(124,58,237,.4) !important; }
.active-outline-text { color: var(--accent) !important; }

/* Final Utilities */
.p-modal-hdr { padding: 16px 20px 0; }
.m-20-8 { margin: 0 20px 8px; }
.min-w-32 { min-width: 32px; }
.w-70-pct { width: 70%; }
.w-55-pct { width: 55%; }
.w-45-pct { width: 45%; }
.w-50-pct { width: 50%; }
.h-2 { height: 2px; }
.h-3 { height: 3px; }
.h-5 { height: 5px; }
.opacity-5 { opacity: 0.5; }
.dashed-top { border-top: 1px dashed var(--border); }
.white-nowrap { white-space: nowrap; }

/* Font Families */
.font-tnr { font-family: 'Times New Roman', serif; }
.font-arial { font-family: Arial, sans-serif; }
.font-georgia { font-family: Georgia, serif; }
.font-cambria { font-family: Cambria, Georgia, serif; }
.font-garamond { font-family: Garamond, serif; }
.font-palatino { font-family: 'Palatino Linotype', serif; }
.font-trebuchet { font-family: 'Trebuchet MS', sans-serif; }
.font-verdana { font-family: Verdana, sans-serif; }
.font-courier { font-family: 'Courier New', monospace; }

/* Markdown Styles */
.md-code {
  background: rgba(59,130,246,.12);
  color: var(--accent2);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: monospace;
}
