:root{
  --primary:#028090; --secondary:#00A896; --accent:#02C39A;
  --dark:#013A40; --darkcard:#024E56;
  --charcoal:#1F2937; --muted:#5B6B72;
  --tint:#EAF7F6; --border:#D6EEEC; --bg:#FFFFFF;
  --warn:#B3541E;
  --page-bg:#FFFFFF; --header-bg:rgba(255,255,255,.92);
  --footer-bg:#013A40; --coffee-tint:#FFF7DA; --coffee-bg:#FBF9F1; --coffee-border:#F0E6C4;
  --highlight-text:#2B2200;
  color-scheme: light;
}
:root[data-theme="dark"]{
  --primary:#3FC6D4; --secondary:#4FD8C4; --accent:#40E0B0;
  --dark:#E7F6F5; --darkcard:#0F3237;
  --charcoal:#EAF3F2; --muted:#9FB4B2;
  --tint:#0F2C30; --border:#1C4247; --bg:#0B2226;
  --warn:#FF9466;
  --page-bg:#081A1D; --header-bg:rgba(8,26,29,.92);
  --footer-bg:#04161A; --coffee-tint:#2B2409; --coffee-bg:#20250F; --coffee-border:#3A3312;
  --highlight-text:#2B2200;
  color-scheme: dark;
}
*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  color:var(--charcoal); background:var(--page-bg); line-height:1.55;
  transition:background-color .2s ease, color .2s ease;
}
.visually-hidden{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); white-space:nowrap; border:0;
}
kbd{
  background:var(--tint); border:1px solid var(--border); border-radius:4px; padding:1px 6px;
  font-family:inherit; font-size:11px; color:var(--charcoal);
}
.kbd-hint{font-size:12px; color:var(--muted); margin:0 0 10px;}
h1,h2,h3{font-family:Georgia,"Cambria","Times New Roman",serif; line-height:1.2; margin:0 0 .5em;}
a{color:var(--primary);}
.wrap{max-width:1080px; margin:0 auto; padding:0 20px;}

/* Header */
header.site{
  position:sticky; top:0; z-index:50; background:var(--header-bg); backdrop-filter:blur(6px);
  border-bottom:1px solid var(--border);
}
.nav{display:flex; align-items:center; justify-content:space-between; padding:14px 20px; max-width:1080px; margin:0 auto; gap:16px; position:relative;}
.brand{display:flex; align-items:center; gap:10px; font-weight:700; font-size:20px; color:var(--dark); text-decoration:none; min-width:0;}
.brand-badge{width:34px; height:34px; border-radius:9px; background:var(--primary); display:flex; align-items:center; justify-content:center; color:#fff; font-size:17px; flex-shrink:0;}
nav.links{display:flex; gap:22px; font-size:14.5px; flex:1;}
nav.links a{color:var(--charcoal); text-decoration:none; font-weight:500;}
nav.links a:hover{color:var(--primary);}
.theme-toggle{
  background:var(--tint); border:1px solid var(--border); border-radius:8px; width:36px; height:36px;
  cursor:pointer; font-size:15px; line-height:1; flex-shrink:0;
}
.menu-toggle{
  display:none; background:var(--tint); border:1px solid var(--border); border-radius:8px; width:36px; height:36px;
  align-items:center; justify-content:center; cursor:pointer; font-size:16px; color:var(--charcoal); flex-shrink:0;
}

/* "Company" nav dropdown (About Us / Contact Us / Privacy Policy / Terms & Conditions) */
.nav-dropdown{position:relative; display:flex; align-items:center;}
.nav-dropdown-toggle{
  background:none; border:none; padding:0; margin:0; font:inherit; font-weight:500; color:var(--charcoal);
  cursor:pointer; display:flex; align-items:center; gap:4px;
}
.nav-dropdown-toggle:hover{color:var(--primary);}
.nav-dropdown-toggle .caret{font-size:10px;}
.nav-dropdown-menu{
  display:none; position:absolute; top:calc(100% + 16px); left:50%; transform:translateX(-50%);
  background:var(--bg); border:1px solid var(--border); border-radius:10px; padding:8px; min-width:180px;
  box-shadow:0 14px 28px rgba(0,0,0,.14); z-index:70;
}
.nav-dropdown-menu a{display:block; padding:9px 10px; border-radius:6px; font-size:14px; font-weight:500; color:var(--charcoal); text-decoration:none; white-space:nowrap;}
.nav-dropdown-menu a:hover{background:var(--tint); color:var(--primary);}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu{display:block;}

/* Hero */
.hero{padding:56px 0 20px; text-align:center;}
.hero h1{font-size:clamp(28px,4.2vw,44px); color:var(--dark); max-width:820px; margin:0 auto .4em;}
.hero p.sub{max-width:660px; margin:0 auto; font-size:17px; color:var(--muted);}
.hero .pills{display:flex; gap:10px; flex-wrap:wrap; justify-content:center; margin-top:20px;}
.pill{background:var(--tint); border:1px solid var(--border); color:var(--primary); font-size:13px; font-weight:600; padding:6px 14px; border-radius:99px;}

/* Support / Buy Me a Coffee */
.support-banner{
  display:flex; align-items:center; justify-content:center; gap:16px; flex-wrap:wrap; text-align:center;
  max-width:1080px; margin:26px auto; padding:16px 22px;
  background:linear-gradient(135deg, var(--tint), var(--coffee-tint));
  border:1px solid var(--border); border-radius:12px;
}
.support-banner p{margin:0; font-size:14.5px; color:var(--charcoal); font-weight:500;}
.bmc-btn{
  display:inline-flex; align-items:center; gap:8px; background:#FFDD00; color:#1a1a1a; font-weight:700;
  font-size:14px; padding:10px 18px; border-radius:8px; text-decoration:none; border:1px solid #E8C700;
  transition:transform .08s ease; white-space:nowrap;
}
.bmc-btn:hover{transform:translateY(-2px);}
.support-card{
  max-width:620px; margin:44px auto; padding:30px; text-align:center;
  background:var(--tint); border:1px solid var(--border); border-radius:16px;
}
.support-card .emoji{font-size:36px; margin-bottom:10px;}
.support-card h3{font-size:19px; margin:0 0 8px; color:var(--dark);}
.support-card p{font-size:14px; color:var(--muted); max-width:440px; margin:0 auto 20px;}

/* Tool card */
.tool-section{padding:10px 0 40px;}
.tool-card{
  background:var(--bg); border:1px solid var(--border); border-radius:16px;
  box-shadow:0 10px 30px rgba(2,50,56,.06); padding:24px; max-width:900px; margin:0 auto;
}
textarea#inputText{
  width:100%; min-height:220px; resize:vertical; border:1px solid var(--border); border-radius:12px;
  padding:16px; font-size:15.5px; font-family:inherit; color:var(--charcoal); background:var(--bg);
}
textarea#inputText:focus{outline:2px solid var(--secondary); outline-offset:1px;}
.meta-row{display:flex; justify-content:space-between; align-items:center; margin-top:10px; flex-wrap:wrap; gap:10px;}
.counts{font-size:13px; color:var(--muted);}
.file-btn{
  display:inline-flex; align-items:center; gap:6px; font-size:13.5px; color:var(--primary); background:var(--tint);
  border:1px solid var(--border); padding:7px 12px; border-radius:8px; cursor:pointer; font-weight:600;
}
.file-btn input{display:none;}

.btn{
  border:none; border-radius:10px; padding:12px 22px; font-size:15px; font-weight:700; cursor:pointer;
  display:inline-flex; align-items:center; gap:8px; transition:transform .08s ease, opacity .15s ease;
}
.btn:active{transform:scale(.97);}
.btn-primary{background:var(--primary); color:#fff;}
.btn-primary:hover{background:#026e7c;}
.btn-primary:disabled{opacity:.5; cursor:not-allowed;}
.btn-ghost{background:var(--tint); color:var(--primary);}
.btn-ghost:hover{background:#DCF2F0;}
.btn-ghost:disabled{opacity:.5; cursor:not-allowed;}
.btn-round{width:44px; height:44px; border-radius:50%; padding:0; justify-content:center;}

.start-row{margin-top:18px; display:flex; justify-content:flex-end;}

/* Reading view */
#readingView{display:none;}
.reader-controls{
  display:flex; flex-wrap:wrap; align-items:center; gap:14px; padding:14px; background:var(--tint);
  border-radius:12px; margin-bottom:16px; border:1px solid var(--border);
}
.transport{display:flex; align-items:center; gap:8px;}
.control-group{display:flex; flex-direction:column; gap:3px; font-size:12px; color:var(--muted); min-width:120px;}
.control-group select, .control-group input[type=range]{width:100%;}
.progress-wrap{flex:1; min-width:180px;}
.progress-track{height:6px; background:var(--border); border-radius:99px; overflow:hidden;}
.progress-fill{height:100%; width:0%; background:var(--accent); transition:width .15s linear;}
.progress-label{font-size:12px; color:var(--muted); margin-top:5px;}

.finder-box{display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-bottom:14px;}
.finder-box input[type=text]{
  flex:1; min-width:180px; padding:10px 12px; border:1px solid var(--border); border-radius:8px; font-size:14px;
  background:var(--bg); color:var(--charcoal);
}
select, input[type=text]{ color-scheme: inherit; }
.control-group select{
  padding:6px 8px; border:1px solid var(--border); border-radius:6px; background:var(--bg); color:var(--charcoal);
}
.finder-status{font-size:12.5px; color:var(--muted); white-space:nowrap;}
.icon-btn{background:var(--bg); border:1px solid var(--border); border-radius:8px; width:36px; height:36px; cursor:pointer; font-size:14px; color:var(--primary);}
.icon-btn:disabled{opacity:.4; cursor:not-allowed;}

.reading-pane{
  max-height:420px; overflow-y:auto; padding:18px; border:1px solid var(--border); border-radius:12px;
  font-size:18px; line-height:1.85; background:var(--bg);
}
.reading-pane .word{padding:1px 2px; border-radius:4px;}
.reading-pane .chunk-active{background:var(--tint);}
.reading-pane .word-active{background:var(--accent); color:#fff;}
.reading-pane .search-match{background:#FFE9A8; color:var(--highlight-text);}
.reading-pane .search-current{background:#FFC94D; color:var(--highlight-text); outline:2px solid var(--warn);}

/* Download */
.download-box{margin-top:16px; padding:14px 16px; background:var(--coffee-bg); border:1px solid var(--coffee-border); border-radius:12px;}
.download-row{display:flex; align-items:center; gap:10px; flex-wrap:wrap;}
.download-label{font-size:13.5px; font-weight:600; color:var(--charcoal); flex:1; min-width:200px;}
.download-box select{padding:8px 10px; border:1px solid var(--border); border-radius:8px; font-size:13px; background:var(--bg); color:var(--charcoal);}
.download-status{font-size:12.5px; color:var(--muted); margin-top:8px; min-height:1.2em;}
.download-status.error{color:#E05A32;}
.download-status.success{color:#1FAE81;}

.back-edit{font-size:13px; margin-top:14px; display:inline-block; cursor:pointer; color:var(--primary); font-weight:600;}

.unsupported{display:none; background:#FDECEA; border:1px solid #F3B9B0; color:#8a2c1d; padding:14px 16px; border-radius:10px; font-size:14px; margin-bottom:16px;}

/* Sections */
section.info{padding:50px 0;}
section.info.tint-bg{background:var(--tint);}
section.info h2{font-size:28px; color:var(--dark); text-align:center; margin-bottom:8px;}
section.info p.lead{text-align:center; color:var(--muted); max-width:600px; margin:0 auto 34px;}

.cards3{display:grid; grid-template-columns:repeat(3,1fr); gap:18px;}
@media(max-width:800px){.cards3{grid-template-columns:1fr;}}
.card{background:var(--bg); border:1px solid var(--border); border-radius:14px; padding:22px;}
.card .num{width:34px; height:34px; border-radius:50%; background:var(--primary); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:14px; margin-bottom:12px;}
.card h3{font-size:17px; margin:0 0 6px; color:var(--charcoal);}
.card p{font-size:14px; color:var(--muted); margin:0;}
#competitors .card{background:var(--tint); border-color:var(--border);}

.usecases{display:grid; grid-template-columns:repeat(4,1fr); gap:16px;}
@media(max-width:900px){.usecases{grid-template-columns:repeat(2,1fr);}}
@media(max-width:520px){.usecases{grid-template-columns:1fr;}}
.usecase{text-align:center; padding:18px 12px;}
.usecase .emoji{font-size:30px; margin-bottom:10px;}
.usecase h3{font-size:15px; margin:0 0 6px;}
.usecase p{font-size:13px; color:var(--muted); margin:0;}

/* About (SEO content) */
.about-content{max-width:760px; margin:0 auto;}
.about-content p{font-size:15px; color:var(--charcoal); margin:0 0 16px;}
.about-content h3{font-size:18px; color:var(--dark); margin:28px 0 10px;}
.about-content h3:first-of-type{margin-top:8px;}

/* FAQ */
.faq{max-width:760px; margin:0 auto;}
details{border:1px solid var(--border); border-radius:10px; padding:14px 18px; margin-bottom:10px; background:var(--bg);}
details summary{cursor:pointer; font-weight:600; font-size:15.5px; color:var(--charcoal); list-style:none; display:flex; justify-content:space-between; align-items:center;}
details summary::-webkit-details-marker{display:none;}
details summary::after{content:"+"; font-size:20px; color:var(--primary); font-weight:400;}
details[open] summary::after{content:"–";}
details p{font-size:14.5px; color:var(--muted); margin:10px 0 2px;}

footer{background:var(--footer-bg); color:#BFE3E0; padding:40px 0 24px; margin-top:20px;}
footer .wrap{display:flex; flex-wrap:wrap; justify-content:space-between; gap:26px;}
footer h4{color:#fff; font-size:14px; margin:0 0 10px;}
footer p, footer a{font-size:12.8px; color:#A9D6D2; line-height:1.7;}
footer a{text-decoration:none;}
footer a:hover{color:#fff;}
footer .footer-col ul{list-style:none; margin:0; padding:0;}
footer .footer-col li{margin-bottom:6px;}
.footer-bottom{border-top:1px solid #0C525B; margin-top:26px; padding-top:16px; text-align:center; font-size:12px; color:#7FB8B4;}
.footer-col{max-width:340px; flex:1 1 220px;}

/* Inner content pages (About Us, Privacy Policy, Terms & Conditions, Contact Us) */
.page-hero{padding:44px 0 8px; text-align:center;}
.breadcrumb{font-size:13px; color:var(--muted); margin:0 0 10px;}
.breadcrumb a{color:var(--muted); text-decoration:none;}
.breadcrumb a:hover{color:var(--primary);}
.page-hero h1{font-size:clamp(26px,4vw,38px); color:var(--dark); margin:0 auto .3em; max-width:760px;}
.page-hero p.sub{max-width:620px; margin:0 auto; font-size:15.5px; color:var(--muted);}
.updated-date{text-align:center; font-size:12.5px; color:var(--muted); margin:0 0 30px;}

.prose{max-width:760px; margin:0 auto; padding:10px 0 60px;}
.prose h2{font-size:21px; color:var(--dark); margin:30px 0 10px;}
.prose h2:first-child{margin-top:0;}
.prose p{font-size:15px; color:var(--charcoal); margin:0 0 16px;}
.prose ul{margin:0 0 16px; padding-left:22px;}
.prose li{font-size:15px; color:var(--charcoal); margin:0 0 8px;}
.prose a{font-weight:600;}
.prose strong{color:var(--dark);}

.contact-cards{display:grid; grid-template-columns:repeat(2,1fr); gap:16px; max-width:760px; margin:0 auto 10px;}
@media(max-width:640px){.contact-cards{grid-template-columns:1fr;}}
.contact-cards .card h3{margin-bottom:8px;}
.contact-cards .card p{font-size:14px; color:var(--muted); margin:0 0 12px;}

/* Error pages (404, 500) */
.error-page{padding:30px 0 70px; text-align:center;}
.error-page .error-code{font-family:Georgia,"Cambria","Times New Roman",serif; font-weight:700; font-size:clamp(64px,12vw,110px); line-height:1; color:var(--primary); opacity:.9; margin:0 0 4px;}
.error-page h1{font-size:clamp(24px,3.4vw,32px); color:var(--dark); margin:0 auto .4em; max-width:600px;}
.error-page p.sub{max-width:560px; margin:0 auto 28px; font-size:15.5px; color:var(--muted);}
.error-actions{display:flex; gap:12px; justify-content:center; flex-wrap:wrap; margin-bottom:38px;}
.error-actions .btn{text-decoration:none;}
.error-suggestions{max-width:440px; margin:0 auto; text-align:left; background:var(--tint); border:1px solid var(--border); border-radius:12px; padding:18px 22px;}
.error-suggestions h2{font-size:14px; color:var(--dark); margin:0 0 10px;}
.error-suggestions ul{margin:0; padding-left:20px;}
.error-suggestions li{font-size:14px; color:var(--charcoal); margin:0 0 8px;}
.error-suggestions a{font-weight:600;}

@media(max-width:640px){
  .footer-col{flex-basis:100%; max-width:none;}
}

@media(max-width:640px){
  .menu-toggle{display:flex;}
  nav.links{
    display:none; position:absolute; top:calc(100% + 1px); left:0; right:0; flex-direction:column; gap:0;
    background:var(--page-bg); border:1px solid var(--border); border-top:none; padding:6px 20px 10px;
    box-shadow:0 14px 24px rgba(0,0,0,.1); z-index:60;
  }
  nav.links.open{display:flex;}
  nav.links a{padding:12px 4px; border-bottom:1px solid var(--border);}
  nav.links a:last-child{border-bottom:none;}
  .hero{padding:40px 0 10px;}
  .tool-card{padding:16px;}

  /* Nav dropdown becomes a plain, always-open sub-list inside the mobile menu */
  .nav-dropdown{display:block;}
  .nav-dropdown-toggle{
    pointer-events:none; color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.04em;
    padding:14px 4px 6px; gap:0;
  }
  .nav-dropdown-toggle .caret{display:none;}
  .nav-dropdown-menu{
    display:block; position:static; transform:none; background:none; border:none; box-shadow:none; padding:0; min-width:0;
  }
  .nav-dropdown-menu a{padding:12px 4px 12px 14px; border-bottom:1px solid var(--border); border-radius:0;}
  .nav-dropdown-menu a:last-child{border-bottom:1px solid var(--border);}
}

@media(max-width:400px){
  .wrap{padding:0 14px;}
  .nav{padding:12px 14px;}
  .brand{font-size:17px;}
  .control-group{min-width:100%;}
}

/* Prevent the sticky header from covering anchor/scroll targets */
#tool, #how, #usecases, #faq, #competitors, #about, #readingView, #inputView{
  scroll-margin-top:78px;
}

@media(max-width:640px){
  .finder-box input[type=text]{ flex-basis:100%; order:1; }
  .finder-box .finder-status{ order:2; }
  .download-row{flex-direction:column; align-items:stretch;}
  .download-box select{width:100%;}
}
