.native-app--ai-humanizer,
.native-app--ai-humanizer * { box-sizing: border-box; }

.native-app--ai-humanizer .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.native-app--ai-humanizer .d-none { display: none !important; }

.tg-rewriter { width: 100%; max-width: 940px; margin: 0 auto; padding: clamp(22px, 4vw, 48px); color: #e9efe6; font-family: Inter, system-ui, sans-serif; }
.tg-rewriter-intro { max-width: 700px; margin: 0 auto clamp(22px, 4vw, 34px); text-align: center; }
.native-app--ai-humanizer .tg-rewriter-intro > p { margin: 0 0 8px; color: #8be0b9; text-transform: uppercase; letter-spacing: .18em; font-size: 10px; font-weight: 800; }
.native-app--ai-humanizer .tg-rewriter-intro h2 { margin: 0; color: #fff8e7; font: 600 clamp(30px, 5vw, 48px)/1.08 Fraunces, Georgia, serif; letter-spacing: -.035em; text-shadow: 0 2px 24px rgba(0, 0, 0, .24); }
.native-app--ai-humanizer .tg-rewriter-intro > span { display: block; max-width: 620px; margin: 13px auto 0; color: #c4d5cb; font-size: clamp(14px, 2vw, 17px); line-height: 1.65; }

.tg-card { overflow: hidden; margin-bottom: 18px; background: #f8f3e7; border: 1px solid rgba(245, 184, 65, .42); border-radius: 18px; box-shadow: 0 28px 65px -42px rgba(0, 0, 0, .95); }
.tg-card-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px clamp(18px, 3vw, 26px); color: #fff8e7; background: linear-gradient(135deg, #163a2b, #10291e); border-bottom: 1px solid rgba(245, 184, 65, .3); }
.tg-card-header > div:first-child { display: grid; gap: 2px; }
.tg-card-header small { color: #8dddb7; text-transform: uppercase; letter-spacing: .14em; font-size: 9px; font-weight: 800; }
.tg-card-header strong { font-size: 17px; }
.tg-word-count { flex: 0 0 auto; padding: 7px 12px; color: #213328; background: #ffd57e; border-radius: 999px; font-size: 12px; font-weight: 800; }
.tg-word-count.text-danger { color: #fff; background: #b94b3c; }

.tg-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0; padding: 0 clamp(14px, 3vw, 22px); background: #efe8d9; border-bottom: 1px solid #d8cfbd; }
.tg-tab { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; padding: 15px 12px 14px; color: #66756d; background: transparent; border: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 750; transition: color .2s ease, background .2s ease; }
.tg-tab:hover { color: #176b50; background: rgba(255,255,255,.34); }
.tg-tab:focus-visible { outline: 3px solid rgba(245, 184, 65, .4); outline-offset: -3px; }
.tg-tab.active { color: #164b38; }
.tg-tab.active::after { content: ''; position: absolute; right: 10%; bottom: -1px; left: 10%; height: 3px; background: linear-gradient(90deg, #f5b841, #7fd7ae); border-radius: 3px 3px 0 0; }
.tg-tab-badge { padding: 3px 7px; color: #57685f; background: rgba(22, 107, 80, .09); border-radius: 999px; font-size: 9px; font-weight: 800; }

.tg-textarea-container { position: relative; background: #fffdf7; }
.tg-textarea { display: none; width: 100%; height: clamp(330px, 46vw, 480px); padding: clamp(20px, 3vw, 28px); color: #26372f; background: #fffdf7; border: 0; border-radius: 0; resize: vertical; font: 400 16px/1.75 Inter, system-ui, sans-serif; }
.tg-textarea.active { display: block; }
.tg-textarea:focus { outline: 0; background: #fff; box-shadow: inset 0 0 0 3px rgba(127, 215, 174, .22); }
.tg-textarea::placeholder { color: #8b9991; }
.tg-textarea[readonly] { background: #fbf7ed; }

.tg-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 13px clamp(14px, 3vw, 22px); background: #efe8d9; border-top: 1px solid #d8cfbd; }
.tg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 14px; color: #244036; background: #fffaf0; border: 1px solid #c9c2b3; border-radius: 10px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 800; transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.tg-btn:hover { transform: translateY(-1px); color: #164b38; background: #fff; border-color: #7e9c8b; }
.tg-btn:focus-visible, .tg-rewrite-btn:focus-visible { outline: 3px solid rgba(245, 184, 65, .45); outline-offset: 2px; }
.tg-btn-clear { color: #8a3124; }
.tg-btn-copy { color: #176b50; }

.tg-rewrite-btn { position: relative; display: flex; align-items: center; justify-content: center; gap: 11px; width: 100%; min-height: 58px; overflow: hidden; padding: 15px 22px; color: #193126; background: linear-gradient(135deg, #f5b841, #ffd57e); border: 1px solid #ffd57e; border-radius: 14px; box-shadow: 0 18px 38px -25px rgba(245, 184, 65, .75); cursor: pointer; font: inherit; font-size: 15px; font-weight: 850; transition: transform .2s ease, filter .2s ease; }
.tg-rewrite-btn:hover { transform: translateY(-2px); filter: brightness(1.04); }
.tg-rewrite-btn b { margin-left: 3px; font-size: 18px; }
.tg-rewrite-btn:disabled { cursor: wait; opacity: .72; transform: none; }
.tg-rewrite-btn::after { content: ''; position: absolute; top: -80%; left: -45%; width: 32%; height: 260%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.48), transparent); transform: rotate(25deg); animation: tg-shine 3.2s ease-in-out infinite; }
@keyframes tg-shine { 0%, 58% { left: -45%; } 100% { left: 125%; } }

.tg-queue { display: flex; align-items: center; gap: 13px; margin-top: 16px; padding: 14px 17px; color: #e9efe6; background: #143729; border: 1px solid rgba(127, 215, 174, .32); border-radius: 12px; }
.tg-queue > div:last-child { display: grid; gap: 3px; }
.tg-status { color: #fff8e7; font-size: 13px; font-weight: 800; }
#queueInfo { color: #aac0b3; font-size: 11px; }
#queuePosition { color: #ffd57e; }
.tg-spinner { width: 22px; height: 22px; flex: 0 0 auto; border: 3px solid rgba(127, 215, 174, .2); border-top-color: #f5b841; border-radius: 50%; animation: tg-spin .85s linear infinite; }
@keyframes tg-spin { to { transform: rotate(360deg); } }

.tg-copied-tooltip { position: fixed; z-index: 9999; padding: 9px 14px; color: #10281d; background: #8be0b9; border: 1px solid #b8f0d5; border-radius: 8px; pointer-events: none; transform: translate(-50%, -100%); box-shadow: 0 12px 28px -18px rgba(0,0,0,.8); animation: tg-fade 1.5s forwards; font-size: 12px; font-weight: 800; }
@keyframes tg-fade { 0% { opacity: 0; transform: translate(-50%, -80%); } 20%, 80% { opacity: 1; transform: translate(-50%, -100%); } 100% { opacity: 0; transform: translate(-50%, -120%); } }

@media (max-width: 620px) {
  .tg-rewriter { padding: 20px 12px 28px; }
  .tg-actions { grid-template-columns: 1fr; }
  .tg-tab { padding-inline: 6px; }
  .tg-tab-badge { display: none; }
  .tg-textarea { height: 360px; }
}
