:root{
  --bg:#11150f;
  --panel:#1b2118;
  --panel-2:#232a1f;
  --soft:#30382a;
  --border:#46503d;
  --text:#f0f0e0;
  --muted:#aeb49b;
  --accent:#c0a888;
  --accent-2:#889078;
  --olive:#505840;
  --sage:#687058;
  --danger:#d98d78;
  --ok:#9cad82;
  --warn:#d8bc8c;
  --shadow:0 18px 60px rgba(0,0,0,.28);
  --radius:22px;
  --radius-sm:14px;
  --max:1180px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at top left,rgba(192,168,136,.10),transparent 28%),
    radial-gradient(circle at 80% 20%,rgba(136,144,120,.08),transparent 24%),
    var(--bg);
  min-height:100vh;
}

a{text-decoration:none;color:inherit}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.45}
.hidden{display:none!important}

.shell{
  width:min(calc(100% - 32px),var(--max));
  margin:0 auto;
}

.topbar{
  position:sticky;
  top:0;
  z-index:30;
  backdrop-filter:blur(16px);
  background:rgba(17,21,15,.84);
  border-bottom:1px solid rgba(255,255,255,.06);
}

.nav{
  min-height:76px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
}

.brand{display:flex;align-items:center;min-width:0}
.brand-logo{
  display:block;
  width:190px;
  max-width:42vw;
  height:auto;
  object-fit:contain;
}

.navlinks{
  display:flex;
  align-items:center;
  gap:8px;
  color:#c8ccb8;
  font-size:14px;
}
.navlinks a{padding:10px 12px;border-radius:12px}
.navlinks a:hover{background:rgba(255,255,255,.05);color:#fff}

.nav-actions{display:flex;gap:10px;align-items:center}
.mobile-menu-toggle{
  display:none;
  border:1px solid var(--border);
  background:var(--panel-2);
  color:var(--text);
  width:42px;height:42px;
  border-radius:12px;
}

.btn{
  border:1px solid var(--border);
  background:var(--panel-2);
  color:#fff;
  padding:11px 15px;
  border-radius:13px;
  font-weight:700;
  transition:.18s ease;
}
.btn:hover{transform:translateY(-1px);border-color:#5b654f}
.btn-accent{
  background:var(--accent);
  color:#1a1d16;
  border-color:var(--accent);
}
.btn-accent:hover{background:#ceb792}
.btn-ghost{background:transparent}

main{padding:36px 0 56px}

.hero{
  display:grid;
  grid-template-columns:1.15fr .85fr;
  gap:22px;
  align-items:stretch;
  margin-bottom:22px;
}
.hero-copy,.status-card,.card,.auth-card{
  border:1px solid var(--border);
  background:linear-gradient(180deg,rgba(255,255,255,.025),rgba(255,255,255,.012));
  box-shadow:var(--shadow);
}
.hero-copy{
  border-radius:28px;
  padding:34px;
  min-height:290px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  overflow:hidden;
  position:relative;
}
.hero-copy::after{
  content:"";
  position:absolute;
  width:220px;height:220px;
  right:-70px;bottom:-85px;
  border-radius:50%;
  background:rgba(192,168,136,.12);
  filter:blur(4px);
}

.eyebrow{
  display:inline-flex;
  gap:8px;
  align-items:center;
  width:max-content;
  padding:8px 11px;
  border-radius:999px;
  background:rgba(192,168,136,.10);
  border:1px solid rgba(192,168,136,.25);
  color:#e7d8bb;
  font-size:12px;
  font-weight:800;
  letter-spacing:.05em;
  text-transform:uppercase;
}

.pulse-dot{
  width:8px;height:8px;border-radius:50%;
  background:var(--accent);
  box-shadow:0 0 0 0 rgba(192,168,136,.45);
  animation:pulse 1.7s infinite;
}
@keyframes pulse{
  70%{box-shadow:0 0 0 10px rgba(192,168,136,0)}
  100%{box-shadow:0 0 0 0 rgba(192,168,136,0)}
}

h1{
  font-size:clamp(42px,7vw,74px);
  line-height:.94;
  letter-spacing:-.06em;
  margin:18px 0 12px;
  max-width:760px;
}
.hero-copy p,.auth-intro p{
  color:var(--muted);
  max-width:640px;
  line-height:1.7;
  margin:0;
  font-size:15px;
}
.hero-cta{display:flex;gap:10px;flex-wrap:wrap;margin-top:24px}

.status-card{
  border-radius:28px;
  padding:24px;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  min-height:290px;
  background:
    linear-gradient(160deg,rgba(192,168,136,.07),rgba(255,255,255,.02) 35%,rgba(255,255,255,.01)),
    var(--panel);
}
.status-top{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}
.status-title{font-weight:800;font-size:15px}
.badge{
  font-size:11px;
  font-weight:800;
  padding:7px 9px;
  border-radius:999px;
  background:rgba(136,144,120,.12);
  color:var(--ok);
  border:1px solid rgba(136,144,120,.22);
}
.big-clock{
  font-size:clamp(42px,7vw,68px);
  letter-spacing:-.05em;
  font-weight:800;
  line-height:1;
  margin:18px 0 6px;
}
.muted{color:var(--muted)}
.tiny{font-size:12px}

.grid{display:grid;gap:18px}
.live-grid{grid-template-columns:repeat(4,1fr);margin-bottom:18px}
.content-grid{grid-template-columns:1.35fr .65fr;align-items:start}
.side-stack{display:grid;gap:18px}

.section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin:30px 0 14px;
}
.section-head h2{margin:0;font-size:20px;letter-spacing:-.03em}
.section-head p{margin:4px 0 0;color:var(--muted);font-size:13px}
.side-stack>.section-head{margin-bottom:0}

.live-card{
  border:1px solid var(--border);
  background:var(--panel);
  border-radius:var(--radius);
  padding:20px;
  position:relative;
  overflow:hidden;
  min-height:190px;
}
.live-card::before{
  content:"";
  position:absolute;
  left:0;top:0;bottom:0;width:3px;
  background:var(--accent);
  opacity:.8;
}
.live-meta{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.market{font-size:18px;font-weight:800;letter-spacing:-.03em}
.market-sub{color:var(--muted);font-size:12px;margin-top:4px}
.state{
  font-size:11px;
  font-weight:800;
  padding:7px 9px;
  border-radius:999px;
  border:1px solid var(--border);
  color:#d7dacb;
  background:rgba(255,255,255,.03);
  white-space:nowrap;
}
.state.wait{color:var(--warn);border-color:rgba(216,188,140,.22);background:rgba(216,188,140,.08)}
.state.done{color:var(--ok);border-color:rgba(156,173,130,.22);background:rgba(156,173,130,.08)}
.countdown{margin-top:24px;font-size:31px;font-weight:800;letter-spacing:-.04em}
.result-box{display:flex;gap:8px;margin-top:20px;flex-wrap:wrap}
.digit{
  width:42px;height:46px;
  border-radius:12px;
  display:grid;place-items:center;
  background:var(--soft);
  border:1px solid var(--border);
  font-weight:900;
  font-size:21px;
}

.card{
  border-radius:var(--radius);
  padding:20px;
  background:var(--panel);
}
.feed{display:grid;gap:14px}
.post{
  border:1px solid var(--border);
  border-radius:18px;
  padding:18px;
  background:var(--panel-2);
}
.post-top{display:flex;gap:12px;align-items:center;justify-content:space-between}
.user{display:flex;align-items:center;gap:10px}
.avatar{
  width:38px;height:38px;border-radius:13px;
  background:linear-gradient(135deg,#687058,#3e4937);
  display:grid;place-items:center;
  font-weight:900;
  border:1px solid #59644e;
}
.avatar-large{width:58px;height:58px;border-radius:18px;font-size:18px}
.user-name{font-weight:800;font-size:14px}
.post-time{font-size:12px;color:var(--muted)}
.post p{color:#e1e2d5;line-height:1.65;font-size:14px;margin:14px 0}
.post-actions{display:flex;gap:10px;flex-wrap:wrap;color:var(--muted);font-size:12px}
.link-button{
  appearance:none;
  border:0;
  background:transparent;
  color:var(--muted);
  padding:0;
  font-size:12px;
}
.link-button:hover{color:var(--text)}
.chip{
  border:1px solid var(--border);
  background:rgba(255,255,255,.03);
  padding:8px 10px;
  border-radius:999px;
  font-size:12px;
}
.tool-card h3,.card h3{margin:0 0 8px;font-size:17px}
.tool-card p,.card p.helper{color:var(--muted);font-size:13px;line-height:1.6;margin:0 0 16px}
.field{display:grid;gap:8px;margin-bottom:14px}
label{font-size:12px;color:#d7dacb;font-weight:700}
select,input,textarea{
  width:100%;
  border:1px solid var(--border);
  background:#151a13;
  color:#fff;
  border-radius:13px;
  padding:12px 13px;
  outline:none;
}
input:focus,select:focus,textarea:focus{border-color:#707b66}
.generator-output{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0;min-height:48px}
.number-pill{
  padding:11px 13px;
  border-radius:12px;
  background:var(--soft);
  border:1px solid var(--border);
  font-weight:900;
  letter-spacing:.08em;
}
.trend-list,.history-list{display:grid;gap:10px}
.trend-row,.history-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 0;
  border-bottom:1px solid rgba(255,255,255,.055);
}
.trend-row:last-child,.history-row:last-child{border-bottom:0}
.trend-name{font-weight:750;font-size:13px}
.trend-meta{color:var(--muted);font-size:12px}
.admin{margin-top:18px;border-style:dashed}
.admin-grid{grid-template-columns:1fr 1fr;gap:12px}
#publishMessage{margin-left:10px}
.notice{
  margin-top:22px;
  border:1px solid rgba(216,188,140,.18);
  background:rgba(216,188,140,.055);
  color:#e5d7bd;
  padding:15px 16px;
  border-radius:16px;
  font-size:12px;
  line-height:1.65;
}
footer{
  border-top:1px solid rgba(255,255,255,.06);
  padding:24px 0 40px;
  color:var(--muted);
  font-size:12px;
}
.footer-wrap{display:flex;justify-content:space-between;gap:18px;flex-wrap:wrap}

.modal{
  position:fixed;inset:0;
  z-index:100;
  display:grid;
  place-items:center;
  background:rgba(0,0,0,.78);
  padding:20px;
}
.modal-card{
  width:min(100%,520px);
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:24px;
  padding:24px;
  box-shadow:0 30px 100px rgba(0,0,0,.5);
}
.modal-card h2{margin:0 0 10px;font-size:25px}
.modal-card p{color:var(--muted);line-height:1.7;font-size:14px}
.modal-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}

/* Auth */
.auth-page main{padding-top:54px}
.auth-layout{
  display:grid;
  grid-template-columns:1fr 520px;
  gap:54px;
  align-items:center;
  min-height:calc(100vh - 120px);
}
.auth-intro h1{max-width:650px}
.auth-benefits{display:grid;gap:12px;margin-top:30px;max-width:580px}
.benefit-item{
  border:1px solid var(--border);
  background:rgba(255,255,255,.025);
  border-radius:16px;
  padding:15px 17px;
  display:grid;
  grid-template-columns:105px 1fr;
  gap:14px;
}
.benefit-item strong{font-size:13px}
.benefit-item span{color:var(--muted);font-size:13px;line-height:1.5}
.auth-card{
  border-radius:26px;
  padding:24px;
  background:var(--panel);
}
.auth-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
  margin-bottom:22px;
}
.auth-head h2{margin:0;font-size:26px;letter-spacing:-.035em}
.auth-head p{margin:5px 0 0;color:var(--muted);font-size:12px}
.input-prefix{
  display:flex;
  align-items:center;
  border:1px solid var(--border);
  border-radius:13px;
  background:#151a13;
  overflow:hidden;
}
.input-prefix span{padding-left:13px;color:var(--muted)}
.input-prefix input{border:0;background:transparent}
.password-wrap{position:relative}
.password-wrap input{padding-right:66px}
.password-toggle{
  position:absolute;
  right:8px;top:50%;
  transform:translateY(-50%);
  border:0;
  background:transparent;
  color:var(--accent);
  font-size:11px;
  font-weight:800;
}
.field-help,.field-error{font-size:11px}
.field-help{color:var(--muted)}
.field-error{color:var(--danger);min-height:13px}
.password-meter{
  height:5px;
  background:#2a3026;
  border-radius:999px;
  overflow:hidden;
}
.password-meter span{
  display:block;
  height:100%;
  width:0%;
  background:var(--accent);
  transition:.2s ease;
}
.check-row{
  display:flex;
  gap:10px;
  align-items:flex-start;
  line-height:1.5;
  margin:12px 0;
  color:#d9ddce;
  font-weight:500;
}
.check-row input{width:auto;margin-top:3px;accent-color:var(--accent)}
.auth-submit{width:100%;margin-top:8px}
.form-status{font-size:12px;min-height:18px;margin-top:10px;color:var(--danger)}
.auth-divider{
  display:flex;align-items:center;gap:12px;
  color:var(--muted);font-size:11px;
  margin:18px 0;
}
.auth-divider::before,.auth-divider::after{
  content:"";height:1px;background:var(--border);flex:1;
}
.auth-secondary{width:100%;background:transparent}
.auth-footnote{
  color:var(--muted);
  font-size:11px;
  text-align:center;
  margin:14px 0 0;
  line-height:1.6;
}
.success-panel{text-align:center;padding:24px 6px 10px}
.success-icon{
  width:64px;height:64px;
  margin:0 auto 18px;
  display:grid;place-items:center;
  border-radius:20px;
  background:rgba(156,173,130,.12);
  border:1px solid rgba(156,173,130,.25);
  color:var(--ok);
  font-size:30px;
  font-weight:900;
}
.success-panel h2{margin:0 0 8px}
.success-panel>p{color:var(--muted);font-size:13px}
.profile-preview{
  display:flex;
  gap:13px;
  align-items:center;
  text-align:left;
  padding:15px;
  border:1px solid var(--border);
  background:var(--panel-2);
  border-radius:18px;
  margin:22px 0;
}
.profile-preview div:last-child{display:grid;gap:4px}
.profile-preview span{color:var(--muted);font-size:12px}
.success-actions{display:grid;gap:10px}

@media (max-width:1050px){
  .live-grid{grid-template-columns:repeat(2,1fr)}
  .auth-layout{grid-template-columns:1fr 470px;gap:30px}
}

@media (max-width:900px){
  .hero,.content-grid,.auth-layout{grid-template-columns:1fr}
  .navlinks{display:none;position:absolute;top:70px;left:16px;right:16px;background:var(--panel);border:1px solid var(--border);border-radius:16px;padding:10px}
  .navlinks.open{display:grid}
  .mobile-menu-toggle{display:block;margin-left:auto}
  .auth-page .mobile-menu-toggle{display:none}
  .auth-intro{padding-top:10px}
  .auth-layout{min-height:auto}
}

@media (max-width:620px){
  .shell{width:min(calc(100% - 20px),var(--max))}
  main{padding-top:20px}
  .hero-copy,.status-card{padding:22px}
  .hero-copy{min-height:260px}
  .nav-actions .btn-ghost{display:none}
  .brand-logo{width:158px;max-width:48vw}
  .live-grid{grid-template-columns:1fr}
  .admin-grid{grid-template-columns:1fr}
  .benefit-item{grid-template-columns:1fr;gap:4px}
  .auth-page main{padding-top:28px}
  .auth-card{padding:18px}
  .post-top{align-items:flex-start}
}


/* Login modal */
.login-modal-card{
  position:relative;
  width:min(100%,460px);
}
.modal-close{
  position:absolute;
  top:14px;
  right:14px;
  width:34px;
  height:34px;
  border-radius:10px;
  border:1px solid var(--border);
  background:var(--panel-2);
  color:var(--text);
  font-size:22px;
  line-height:1;
}
.login-modal-card h2{
  margin:16px 0 8px;
}
.login-modal-card > p{
  margin-bottom:18px;
}
.demo-credential-box{
  margin-top:18px;
  display:grid;
  gap:8px;
  padding:14px;
  border:1px dashed var(--border);
  border-radius:15px;
  background:rgba(255,255,255,.025);
}
.demo-credential-box > div{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.demo-credential-box span{
  color:var(--muted);
  font-size:11px;
}
.demo-credential-box strong{
  font-size:12px;
  word-break:break-all;
}
.account-menu{
  display:flex;
  align-items:center;
  gap:8px;
}
.account-pill{
  display:flex;
  align-items:center;
  gap:9px;
  border:1px solid var(--border);
  background:var(--panel-2);
  border-radius:13px;
  padding:8px 11px;
  color:var(--text);
}
.account-mini-avatar{
  width:28px;
  height:28px;
  border-radius:9px;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,#687058,#3e4937);
  border:1px solid #59644e;
  font-size:11px;
  font-weight:900;
}
.logout-btn{
  padding:9px 11px;
  font-size:12px;
}


/* Extended prototype pages */
.active-link{
  color:var(--text)!important;
  background:rgba(255,255,255,.05);
}

.page-main{padding-top:34px}
.page-hero{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:24px;
  margin-bottom:24px;
}
.compact-hero h1{
  margin:12px 0 10px;
  font-size:clamp(38px,6vw,66px);
}
.compact-hero p{
  color:var(--muted);
  margin:0;
  max-width:650px;
}

.community-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  margin-bottom:18px;
}
.tabs,.profile-tabs{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.tab-btn{
  border:1px solid var(--border);
  background:var(--panel-2);
  color:var(--muted);
  padding:10px 13px;
  border-radius:12px;
  font-weight:700;
}
.tab-btn.active{
  background:var(--accent);
  border-color:var(--accent);
  color:#1a1d16;
}
.community-search{
  max-width:280px;
}
.community-layout{
  display:grid;
  grid-template-columns:1fr 320px;
  gap:18px;
  align-items:start;
}

.empty-state{
  text-align:center;
  padding:42px 22px;
}
.empty-state h3,.empty-state h2{margin:8px 0}
.empty-state p{
  color:var(--muted);
  max-width:520px;
  margin:0 auto 18px;
  line-height:1.6;
}
.empty-icon{font-size:32px;margin-bottom:6px}
.danger-link{color:var(--danger)!important}

/* Compose */
.compose-layout{
  display:grid;
  grid-template-columns:1fr 360px;
  gap:22px;
  align-items:start;
  padding-top:42px;
}
.compose-card{
  border:1px solid var(--border);
  background:var(--panel);
  border-radius:24px;
  padding:22px;
  box-shadow:var(--shadow);
}
.compose-head{margin-top:0}
.compose-head h1{font-size:28px;margin:10px 0 5px}
.compose-author{
  display:flex;
  gap:10px;
  align-items:center;
  margin:8px 0 18px;
  padding:12px;
  border:1px solid var(--border);
  border-radius:15px;
  background:var(--panel-2);
}
.compose-author>div:last-child{display:grid;gap:2px}
.compose-author span{font-size:11px;color:var(--muted)}
.compose-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.compose-counter{
  text-align:right;
  color:var(--muted);
  font-size:11px;
}
.compose-actions{
  display:flex;
  gap:10px;
  margin-top:18px;
}
.preview-post{box-shadow:none}
.login-required-panel{
  text-align:center;
  padding:45px 18px;
}
.login-required-panel p{color:var(--muted)}

/* Profile */
.profile-header-card{
  overflow:hidden;
  border:1px solid var(--border);
  background:var(--panel);
  border-radius:26px;
  box-shadow:var(--shadow);
}
.profile-cover{
  height:150px;
  background:
    linear-gradient(130deg,rgba(192,168,136,.36),rgba(104,112,88,.3)),
    radial-gradient(circle at 15% 20%,rgba(240,240,224,.08),transparent 28%),
    var(--olive);
}
.profile-header-body{
  display:flex;
  align-items:flex-end;
  gap:18px;
  padding:0 24px 22px;
}
.profile-avatar-xl{
  width:104px;
  height:104px;
  margin-top:-52px;
  border-radius:30px;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg,#889078,#505840);
  border:5px solid var(--panel);
  font-size:28px;
  font-weight:900;
}
.profile-main-info{flex:1;padding-top:16px}
.profile-main-info h1{
  font-size:30px;
  margin:0;
  letter-spacing:-.035em;
}
.profile-handle{color:var(--muted);font-size:13px;margin-top:3px}
.profile-main-info p{
  color:#dfe2d5;
  font-size:13px;
  line-height:1.6;
  margin:10px 0 5px;
  max-width:620px;
}
.profile-meta{color:var(--muted);font-size:11px}
.profile-stats{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  border-top:1px solid var(--border);
}
.profile-stats>div{
  text-align:center;
  padding:16px;
  border-right:1px solid var(--border);
}
.profile-stats>div:last-child{border-right:0}
.profile-stats strong{display:block;font-size:20px}
.profile-stats span{display:block;color:var(--muted);font-size:11px;margin-top:3px}
.profile-tabs{
  margin:18px 0;
}
.profile-tab-panel{margin-bottom:40px}
.settings-card{max-width:680px}
.settings-card #settingsMessage{margin-left:10px}
.profile-history-list .history-row{padding:14px 0}

@media (max-width:900px){
  .community-layout,.compose-layout{grid-template-columns:1fr}
  .compose-side{order:-1}
  .profile-header-body{align-items:flex-start;flex-wrap:wrap}
  .profile-main-info{min-width:220px}
}

@media (max-width:620px){
  .page-hero,.community-toolbar{align-items:stretch;flex-direction:column}
  .community-search{max-width:none}
  .compose-grid{grid-template-columns:1fr}
  .compose-actions{flex-direction:column}
  .profile-header-body{padding:0 16px 18px}
  .profile-avatar-xl{width:86px;height:86px;margin-top:-43px;border-radius:24px}
  .profile-header-body>.btn{width:100%}
  .profile-stats>div{padding:13px 8px}
}


/* Private admin prototype */
.admin-page{
  background:
    radial-gradient(circle at 20% 0%,rgba(192,168,136,.08),transparent 24%),
    var(--bg);
}
.admin-shell{
  width:min(calc(100% - 32px),1320px);
  margin:0 auto;
  padding:34px 0 60px;
}
.admin-login-card{
  width:min(100%,460px);
  margin:7vh auto 0;
  border:1px solid var(--border);
  background:var(--panel);
  border-radius:26px;
  padding:26px;
  box-shadow:var(--shadow);
}
.admin-login-card h1{
  font-size:32px;
  line-height:1.05;
  margin:16px 0 9px;
  letter-spacing:-.04em;
}
.admin-login-card>p{
  color:var(--muted);
  font-size:13px;
  line-height:1.65;
}
.admin-logo{
  width:210px;
  max-width:70%;
  display:block;
  margin-bottom:22px;
}
.admin-logo-small{
  width:145px;
  display:block;
}
.admin-topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:18px;
  padding:16px 18px;
  border:1px solid var(--border);
  background:var(--panel);
  border-radius:20px;
  margin-bottom:18px;
}
.admin-topbar>div{
  display:flex;
  align-items:center;
  gap:18px;
}
.admin-topbar>div>div{
  display:grid;
  gap:3px;
}
.admin-topbar span{
  color:var(--muted);
  font-size:11px;
}
.admin-summary-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:14px;
  margin-bottom:18px;
}
.admin-stat-card{
  border:1px solid var(--border);
  background:var(--panel);
  border-radius:18px;
  padding:18px;
}
.admin-stat-card span{
  color:var(--muted);
  font-size:11px;
}
.admin-stat-card strong{
  display:block;
  font-size:28px;
  margin-top:7px;
}
.admin-dashboard-grid{
  display:grid;
  grid-template-columns:.8fr 1.2fr;
  gap:18px;
  align-items:start;
}
.admin-panel-card{
  box-shadow:none;
}
.admin-section-head{
  margin-top:0;
}
.admin-result-list{
  display:grid;
  gap:8px;
  margin-top:18px;
}
.admin-result-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px 14px;
  background:var(--panel-2);
}
.admin-result-row>div:first-child{
  display:grid;
  gap:3px;
}
.admin-result-row span{
  color:var(--muted);
  font-size:10px;
}
.admin-result-value{
  font-size:20px;
  font-weight:900;
  letter-spacing:.12em;
}
.admin-moderation-toolbar{
  display:grid;
  grid-template-columns:1fr 180px;
  gap:10px;
  margin-bottom:14px;
}
.admin-post-list{
  display:grid;
  gap:10px;
}
.admin-post-item{
  display:flex;
  align-items:flex-start;
  gap:16px;
  justify-content:space-between;
  border:1px solid var(--border);
  border-radius:16px;
  background:var(--panel-2);
  padding:14px;
}
.admin-post-main{
  min-width:0;
}
.admin-post-main p{
  color:#dfe2d5;
  line-height:1.55;
  font-size:13px;
  margin:9px 0;
}
.admin-post-meta{
  display:flex;
  gap:6px;
  align-items:center;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:10px;
}
.admin-post-meta strong{
  color:var(--text);
  font-size:12px;
}
.danger-button{
  border-color:rgba(217,141,120,.28);
  color:#efb0a0;
  background:rgba(217,141,120,.06);
}
.danger-button:hover{
  border-color:rgba(217,141,120,.5);
}
.admin-danger-zone{
  margin-top:18px;
}
.admin-danger-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

@media (max-width:950px){
  .admin-summary-grid{grid-template-columns:repeat(2,1fr)}
  .admin-dashboard-grid{grid-template-columns:1fr}
}
@media (max-width:620px){
  .admin-shell{width:min(calc(100% - 20px),1320px);padding-top:18px}
  .admin-summary-grid{grid-template-columns:1fr 1fr}
  .admin-moderation-toolbar{grid-template-columns:1fr}
  .admin-post-item{flex-direction:column}
  .admin-post-item .btn{width:100%}
  .admin-topbar>div{gap:10px}
  .admin-logo-small{width:110px}
}


/* Post detail popup */
body.modal-open{overflow:hidden}

.post-clickable{
  cursor:pointer;
  transition:transform .18s ease,border-color .18s ease,background .18s ease;
}
.post-clickable:hover{
  transform:translateY(-1px);
  border-color:#5f6a53;
  background:#252d22;
}
.post-clickable:focus{
  outline:2px solid rgba(192,168,136,.45);
  outline-offset:2px;
}

.post-detail-modal{
  position:fixed;
  inset:0;
  z-index:120;
  display:grid;
  place-items:center;
  padding:26px;
}
.post-detail-backdrop{
  position:absolute;
  inset:0;
  background:rgba(3,5,3,.78);
  backdrop-filter:blur(5px);
}
.post-detail-dialog{
  position:relative;
  z-index:1;
  width:min(1180px,100%);
  max-height:88vh;
  overflow:auto;
  border:1px solid #59644e;
  border-radius:26px;
  background:
    linear-gradient(145deg,rgba(136,144,120,.08),rgba(255,255,255,.015)),
    #1b2118;
  box-shadow:0 34px 120px rgba(0,0,0,.5);
}
.post-detail-close{
  position:absolute;
  top:16px;
  right:16px;
  z-index:4;
}
.post-detail-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 280px;
}
.post-detail-main{
  padding:30px;
  min-width:0;
}
.post-detail-side{
  padding:68px 20px 24px 0;
  display:grid;
  align-content:start;
  gap:14px;
}
.post-detail-post h2{
  font-size:28px;
  line-height:1.2;
  letter-spacing:-.035em;
  margin:24px 0 12px;
}
.post-detail-author{font-size:16px}
.post-detail-body{
  color:#e2e5d8;
  font-size:15px;
  line-height:1.8;
  margin:0;
}
.post-detail-actions{
  display:flex;
  gap:22px;
  align-items:center;
  flex-wrap:wrap;
  margin-top:24px;
}
.detail-action{
  border:0;
  background:transparent;
  color:#d8dccf;
  padding:0;
  font-weight:700;
  font-size:13px;
}
button.detail-action:hover{color:var(--accent)}
.post-detail-divider{
  height:1px;
  background:var(--border);
  margin:24px 0 18px;
}
.post-comments-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin-bottom:12px;
}
.post-comments-head h3{
  margin:0 0 3px;
}
.comment-sort{
  width:auto;
  min-width:120px;
  padding:9px 11px;
}
.post-comments-list{
  display:grid;
  border:1px solid var(--border);
  border-radius:18px;
  overflow:hidden;
}
.comment-card{
  display:grid;
  grid-template-columns:40px 1fr;
  gap:12px;
  padding:16px;
  background:rgba(255,255,255,.012);
  border-bottom:1px solid var(--border);
}
.comment-card:last-child{border-bottom:0}
.comment-meta{
  display:flex;
  align-items:center;
  gap:9px;
}
.comment-meta strong{font-size:13px}
.comment-meta span{font-size:11px;color:var(--muted)}
.comment-content p{
  margin:7px 0 0;
  color:#dce0d2;
  font-size:13px;
  line-height:1.65;
}
.empty-comments{
  padding:30px 18px;
  text-align:center;
  color:var(--muted);
  font-size:12px;
}
.comment-form{
  display:grid;
  grid-template-columns:42px 1fr;
  gap:12px;
  align-items:start;
  margin-top:16px;
}
.comment-input-wrap{
  border:1px solid var(--border);
  background:#151a13;
  border-radius:16px;
  padding:10px;
}
.comment-input-wrap textarea{
  border:0;
  background:transparent;
  padding:4px;
  resize:vertical;
  min-height:56px;
}
.comment-input-wrap textarea:focus{border:0}
.comment-form-bottom{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding-top:8px;
}
.comment-form-bottom .btn{padding:9px 16px}
.post-side-card{
  border:1px solid var(--border);
  border-radius:18px;
  background:rgba(255,255,255,.018);
  padding:16px;
}
.post-side-card h3{
  margin:0 0 14px;
  font-size:14px;
}
.post-author-main{
  display:flex;
  gap:11px;
  align-items:center;
  margin-bottom:13px;
}
.post-author-main>div:last-child{
  display:grid;
  gap:3px;
}
.post-author-main strong{font-size:13px}
.post-author-main span{font-size:11px;color:var(--muted)}
.post-author-card .btn{
  width:100%;
  text-align:center;
}
.related-tags{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.guideline-list{
  margin:0;
  padding-left:18px;
  color:#d8dccf;
  font-size:11px;
  line-height:1.7;
}
.guideline-list li+li{margin-top:7px}

@media (max-width:900px){
  .post-detail-dialog{max-height:92vh}
  .post-detail-layout{grid-template-columns:1fr}
  .post-detail-side{
    padding:0 20px 24px;
    grid-template-columns:1fr 1fr;
  }
}
@media (max-width:620px){
  .post-detail-modal{padding:8px}
  .post-detail-dialog{
    max-height:96vh;
    border-radius:20px;
  }
  .post-detail-main{padding:22px 16px}
  .post-detail-side{
    grid-template-columns:1fr;
    padding:0 16px 18px;
  }
  .post-detail-post h2{font-size:22px}
  .post-comments-head{align-items:flex-start}
  .comment-form{grid-template-columns:1fr}
  .comment-avatar{display:none}
}


/* Demo-user-first UX */
.nav-notification-wrap{position:relative}
.notification-btn{
  position:relative;
  width:42px;height:42px;
  border-radius:13px;
  border:1px solid var(--border);
  background:var(--panel-2);
  color:var(--text);
}
.notification-count{
  position:absolute;
  right:-5px;top:-5px;
  min-width:18px;height:18px;
  display:grid;place-items:center;
  padding:0 5px;
  border-radius:999px;
  background:var(--accent);
  color:#1a1d16;
  border:2px solid var(--bg);
  font-size:9px;
  font-weight:900;
}
.notification-panel{
  position:absolute;
  top:52px;
  right:0;
  width:min(380px,calc(100vw - 24px));
  border:1px solid var(--border);
  background:var(--panel);
  border-radius:18px;
  box-shadow:0 24px 80px rgba(0,0,0,.42);
  overflow:hidden;
  z-index:60;
}
.notification-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 15px;
  border-bottom:1px solid var(--border);
}
.notification-head>div{display:grid;gap:2px}
.notification-head strong{font-size:13px}
.notification-head span{font-size:10px;color:var(--muted)}
.notification-list{display:grid}
.notification-item{
  display:grid;
  grid-template-columns:26px 1fr;
  gap:10px;
  text-align:left;
  border:0;
  border-bottom:1px solid var(--border);
  background:transparent;
  color:var(--text);
  padding:12px 14px;
}
.notification-item:last-child{border-bottom:0}
.notification-item.unread{background:rgba(192,168,136,.05)}
.notification-item strong{display:block;font-size:11px;line-height:1.45}
.notification-item small{display:block;color:var(--muted);font-size:9px;margin-top:3px}
.notification-icon{font-size:14px}
.notification-empty{padding:18px;color:var(--muted);font-size:11px;text-align:center}

.comment-actions-row{
  display:flex;
  gap:12px;
  margin-top:8px;
}
.comment-replies{
  display:grid;
  gap:10px;
  margin-top:12px;
  padding-left:14px;
  border-left:2px solid var(--border);
}
.comment-reply{
  display:grid;
  grid-template-columns:30px 1fr;
  gap:9px;
  padding-top:8px;
}
.avatar-small{
  width:30px;
  height:30px;
  border-radius:10px;
  font-size:10px;
}
.comment-reply p{
  margin:5px 0 5px;
  color:#dce0d2;
  font-size:12px;
  line-height:1.55;
}
.comment-reply-context{
  margin-top:14px;
  padding:9px 11px;
  border:1px solid var(--border);
  border-radius:12px;
  background:rgba(192,168,136,.05);
  color:var(--muted);
  font-size:11px;
}
.comment-reply-context strong{color:var(--text)}
.comment-reply-context .link-button{margin-left:8px}
.author-card-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.author-card-actions .btn{text-align:center}
.admin-report-actions{display:flex;gap:8px;flex-wrap:wrap}
.admin-reports-section{margin-top:18px}

@media(max-width:620px){
  .notification-panel{right:-60px}
  .author-card-actions{grid-template-columns:1fr}
  .admin-report-actions{width:100%}
  .admin-report-actions .btn{flex:1}
}


/* LOGIN MODAL FIX — must never render as page content */
.modal.hidden,
#loginModal.hidden {
  display: none !important;
}

#loginModal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 20px;
}

#loginModal .modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 3, .78);
  backdrop-filter: blur(5px);
}

#loginModal .login-modal-card {
  position: relative;
  z-index: 2;
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  margin: 0;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 28px 90px rgba(0,0,0,.52);
}

#loginModal .login-modal-card h2 {
  margin: 6px 0 8px;
}

#loginModal .login-modal-card > p {
  margin: 0 0 20px;
  color: var(--muted);
}

#loginModal .auth-submit {
  width: 100%;
  margin-top: 6px;
}

#loginModal .auth-secondary {
  display: block;
  width: 100%;
  text-align: center;
}

#loginModal .modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

@media (max-width: 520px) {
  #loginModal {
    padding: 10px;
  }

  #loginModal .login-modal-card {
    width: 100%;
    padding: 22px 16px;
    border-radius: 18px;
  }
}


/* =========================================================
   REVISION: single Community Feed + editable profile
   ========================================================= */

.tools-home-section {
  margin-top: 30px;
}

.tools-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: 18px;
  align-items: start;
}

.tools-home-grid > .card,
.tools-home-grid > div,
.tools-home-grid > section {
  min-width: 0;
}

.input-rule {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.avatar-has-photo {
  overflow: hidden;
  padding: 0 !important;
}

.avatar-has-photo img,
.profile-avatar-xl.avatar-has-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.profile-photo-editor {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  align-items: center;
  margin: 18px 0 22px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.015);
}

.profile-photo-preview {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #6f795f, #3f4939);
  border: 1px solid var(--border);
  font-size: 24px;
  font-weight: 900;
}

.profile-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-photo-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.profile-photo-controls .tiny,
.profile-photo-controls .field-error {
  width: 100%;
  margin: 0;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.settings-field-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.settings-title-row h3 {
  margin-bottom: 4px;
}

@media (max-width: 760px) {
  .tools-home-grid {
    grid-template-columns: 1fr;
  }

  .profile-photo-editor {
    grid-template-columns: 1fr;
  }
}


/* Dedicated Tools architecture */
.live-bridge-card{
  margin-top:24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  padding:22px;
  border:1px solid var(--border);
  border-radius:22px;
  background:linear-gradient(135deg,rgba(192,168,136,.06),rgba(255,255,255,.015));
}
.live-bridge-card h2{
  margin:10px 0 5px;
  font-size:22px;
}
.live-bridge-card p{
  margin:0;
  color:var(--muted);
  font-size:13px;
  line-height:1.6;
}
.live-discuss-link{
  display:inline-block;
  margin-top:20px;
  color:var(--accent);
  font-size:11px;
  font-weight:800;
}
.live-discuss-link:hover{text-decoration:underline}

.tools-page-hero{
  padding-top:10px;
}
.tools-page-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) 360px;
  gap:18px;
  align-items:start;
}
.tools-primary-card{
  min-height:520px;
}
.tools-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
}
.tools-primary-card h2{
  margin:0 0 7px;
  font-size:24px;
}
.tools-form-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:24px;
}
.tools-actions,
.tools-result-actions{
  display:flex;
  gap:9px;
  flex-wrap:wrap;
}
.generator-stage{
  min-height:165px;
  display:grid;
  place-items:center;
  margin:22px 0 16px;
  padding:20px;
  border:1px dashed var(--border);
  border-radius:18px;
  background:rgba(255,255,255,.012);
}
.generator-empty{
  color:var(--muted);
  font-size:12px;
}
.tools-generator-output{
  justify-content:center;
  align-items:center;
  min-height:0;
  margin:0;
}
.tools-generator-output .number-pill{
  font-size:20px;
  padding:14px 16px;
}
.tools-result-actions{
  padding-top:4px;
}
#toolMessage{
  min-height:18px;
  margin-top:10px;
}
.tool-rule-list{
  display:grid;
  gap:12px;
}
.tool-rule-list>div{
  display:grid;
  gap:3px;
  padding-bottom:11px;
  border-bottom:1px solid rgba(255,255,255,.05);
}
.tool-rule-list>div:last-child{
  border-bottom:0;
  padding-bottom:0;
}
.tool-rule-list strong{font-size:12px}
.tool-rule-list span{
  color:var(--muted);
  font-size:11px;
  line-height:1.5;
}
.history-date{
  color:var(--muted);
  font-size:9px;
  margin-top:4px;
}
.tools-history-row{
  align-items:flex-start;
}

@media(max-width:900px){
  .tools-page-grid{grid-template-columns:1fr}
  .live-bridge-card{align-items:flex-start;flex-direction:column}
}
@media(max-width:620px){
  .tools-form-grid{grid-template-columns:1fr}
  .tools-result-actions .btn{flex:1 1 100%}
}


/* =========================================================
   V15 — MOBILE RESPONSIVE PASS
   ========================================================= */
html,body{max-width:100%;overflow-x:hidden}
img,video,svg{max-width:100%}
input,select,textarea,button{max-width:100%}

@media(max-width:900px){
  input,select,textarea{font-size:16px}
  .nav{min-height:66px;gap:10px;position:relative}
  .brand-logo{width:158px;max-width:44vw}
  .mobile-menu-toggle{display:grid;place-items:center;flex:0 0 42px;margin-left:auto;order:2}
  .nav-actions{order:3;gap:7px}
  .navlinks{
    display:none;position:absolute;top:calc(100% + 8px);left:0;right:0;z-index:80;
    padding:8px;border:1px solid var(--border);border-radius:16px;
    background:rgba(27,33,24,.98);box-shadow:0 22px 70px rgba(0,0,0,.42)
  }
  .navlinks.open{display:grid;gap:3px}
  .navlinks a{width:100%;padding:13px 14px;border-radius:11px;font-size:14px}
  .hero,.content-grid,.community-layout,.compose-layout,.tools-page-grid,.admin-dashboard-grid{grid-template-columns:1fr!important}
  .hero{gap:14px}
  .hero-copy,.status-card{min-height:auto}
  .live-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .page-hero{align-items:flex-start}
  .community-layout>*,.compose-layout>*,.tools-page-grid>*,.post-detail-layout>*{min-width:0}
  .post-detail-dialog{width:min(100%,760px)}
  .post-detail-layout{grid-template-columns:1fr}
  .post-detail-side{grid-template-columns:1fr 1fr}
  .profile-header-body{flex-wrap:wrap}
  .profile-main-info{min-width:0;flex:1 1 280px}
  .profile-photo-editor{grid-template-columns:96px minmax(0,1fr)}
  .admin-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(max-width:620px){
  :root{--radius:18px;--radius-sm:12px}
  .shell{width:calc(100% - 20px)}
  .nav{min-height:62px}
  .brand-logo{width:136px;max-width:38vw}
  .mobile-menu-toggle{width:40px;height:40px;flex-basis:40px}
  .nav-actions{gap:5px}
  .nav-actions>.btn{min-height:40px;padding:9px 11px;font-size:12px}
  .nav-actions>.btn-accent{display:none}
  .notification-btn{width:40px;height:40px}
  .account-pill{min-height:40px;padding:5px 7px}
  .account-pill>span:last-child{display:none}
  .account-mini-avatar{width:28px;height:28px}
  .logout-btn{display:none}
  .notification-panel{
    position:fixed;top:70px;left:10px;right:10px;width:auto;
    max-height:calc(100dvh - 84px);overflow-y:auto
  }
  main,.page-main{padding-top:18px;padding-bottom:36px}
  .hero{margin-bottom:16px}
  .hero-copy,.status-card,.card,.live-card{border-radius:18px}
  .hero-copy,.status-card{padding:19px}
  .hero-copy{min-height:0}
  h1,.compact-hero h1{font-size:clamp(34px,12vw,48px);line-height:.98;letter-spacing:-.045em}
  .hero-copy p,.auth-intro p,.compact-hero p{font-size:13px;line-height:1.62}
  .hero-cta{display:grid;grid-template-columns:1fr;width:100%}
  .hero-cta .btn{width:100%;text-align:center}
  .status-top{gap:8px}
  .big-clock{font-size:clamp(38px,14vw,56px)}
  .section-head{align-items:flex-start;margin-top:24px}
  .section-head h2{font-size:18px}
  .section-head p{line-height:1.5}
  .live-grid{grid-template-columns:1fr;gap:12px}
  .live-card{min-height:0;padding:17px}
  .market{font-size:17px}
  .live-meta{gap:8px}
  .state{flex:0 0 auto;font-size:9px;padding:6px 7px}
  .result-box{flex-wrap:wrap}
  .digit{min-width:38px}
  .live-bridge-card{padding:18px;border-radius:18px;gap:16px}
  .live-bridge-card .btn{width:100%;text-align:center}
  .page-hero,.community-toolbar{flex-direction:column;align-items:stretch;gap:14px}
  .community-toolbar{margin-bottom:14px}
  .tabs,.profile-tabs{
    flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px;scrollbar-width:none;
    -webkit-overflow-scrolling:touch
  }
  .tabs::-webkit-scrollbar,.profile-tabs::-webkit-scrollbar{display:none}
  .tab-btn{flex:0 0 auto;min-height:42px;padding:10px 12px}
  .community-search{max-width:none;width:100%}
  .post{padding:16px}
  .post-top{gap:9px}
  .post-top .chip{max-width:42%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .post-actions{gap:5px 12px;flex-wrap:wrap}
  .post-actions button,.post-actions span{min-height:32px;display:inline-flex;align-items:center}
  .post-detail-modal{padding:0;align-items:end}
  .post-detail-dialog{width:100%;max-height:94dvh;border-radius:22px 22px 0 0;border-bottom:0}
  .post-detail-main{padding:18px 14px}
  .post-detail-side{grid-template-columns:1fr;padding:0 14px 16px}
  .post-detail-post h2{font-size:20px;line-height:1.18}
  .post-detail-actions{gap:5px;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}
  .post-detail-actions::-webkit-scrollbar{display:none}
  .detail-action{flex:0 0 auto;min-height:38px}
  .post-comments-head{gap:8px}
  .comment-form{grid-template-columns:1fr}
  .comment-avatar{display:none}
  .comment-card{grid-template-columns:34px minmax(0,1fr);gap:9px}
  .comment-replies{padding-left:9px}
  .comment-reply{grid-template-columns:28px minmax(0,1fr)}
  .compose-grid,.tools-form-grid{grid-template-columns:1fr}
  .compose-actions,.tools-actions,.tools-result-actions{display:grid;grid-template-columns:1fr}
  .compose-actions .btn,.tools-actions .btn,.tools-result-actions .btn{width:100%}
  .generator-stage{min-height:135px;padding:14px}
  .tools-generator-output{gap:8px}
  .tools-generator-output .number-pill{font-size:17px;padding:12px 13px}
  .tools-card-head{gap:10px}
  .tools-primary-card h2{font-size:20px}
  .profile-header-body{padding:0 14px 16px;gap:12px}
  .profile-avatar-xl{width:78px;height:78px;margin-top:-39px;border-radius:21px}
  .profile-main-info{flex-basis:calc(100% - 94px);padding-top:8px}
  .profile-main-info h1{font-size:25px}
  .profile-header-body>.btn{width:100%}
  .profile-stats{overflow:hidden}
  .profile-stats>div{min-width:0;padding:12px 5px}
  .profile-stats strong{font-size:17px}
  .profile-stats span{font-size:9px}
  .profile-photo-editor{grid-template-columns:1fr;padding:13px}
  .profile-photo-preview{width:88px;height:88px}
  .profile-photo-controls{align-items:stretch}
  .profile-photo-controls .btn{text-align:center}
  .settings-actions{align-items:stretch;flex-direction:column}
  .settings-actions .btn{width:100%}
  #loginModal{padding:10px}
  .login-modal-card,#loginModal .login-modal-card{
    width:100%;max-height:92dvh;padding:22px 15px 16px;border-radius:20px
  }
  .auth-card{padding:16px}
  .auth-grid{grid-template-columns:1fr}
  .admin-shell{width:calc(100% - 16px);padding-top:12px}
  .admin-topbar{padding:10px}
  .admin-topbar>div{flex-wrap:wrap}
  .admin-logo-small{width:110px}
  .admin-summary-grid{grid-template-columns:1fr 1fr;gap:9px}
  .admin-stat-card{padding:13px}
  .admin-stat-card strong{font-size:24px}
  .admin-result-row{grid-template-columns:1fr;gap:8px}
  .admin-moderation-toolbar{grid-template-columns:1fr}
  .admin-post-item{flex-direction:column;gap:12px}
  .admin-post-item .btn,.admin-report-actions,.admin-report-actions .btn{width:100%}
  footer{padding-bottom:max(18px,env(safe-area-inset-bottom))}
  .footer-wrap{flex-direction:column;align-items:flex-start;gap:7px;line-height:1.5}
}

@media(max-width:420px){
  .shell{width:calc(100% - 16px)}
  .brand-logo{width:122px;max-width:36vw}
  .nav{gap:6px}
  .nav-actions>.btn{padding-inline:9px}
  .eyebrow{font-size:10px;padding:7px 9px}
  h1,.compact-hero h1{font-size:33px}
  .hero-copy,.status-card,.live-card,.card{padding-left:14px;padding-right:14px}
  .live-meta{flex-direction:column}
  .state{align-self:flex-start}
  .post-top{flex-wrap:wrap}
  .post-top .chip{max-width:100%}
  .profile-avatar-xl{width:70px;height:70px;margin-top:-35px}
  .profile-main-info{flex-basis:calc(100% - 84px)}
  .admin-summary-grid{grid-template-columns:1fr}
}

@supports(padding:max(0px)){
  @media(max-width:620px){
    .topbar .shell{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
    .post-detail-main{padding-bottom:max(18px,env(safe-area-inset-bottom))}
  }
}


/* =========================================================
   V16 — PROFILE FOLLOWING
   ========================================================= */

.profile-stats-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.profile-stat-button {
  appearance: none;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: center;
  padding: 16px;
  cursor: pointer;
  transition: background .16s ease;
}

.profile-stat-button:last-child {
  border-right: 0;
}

.profile-stat-button:hover {
  background: rgba(255,255,255,.025);
}

.profile-stat-button strong {
  display: block;
  font-size: 20px;
}

.profile-stat-button span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}

.tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(192,168,136,.10);
  color: var(--accent);
  font-size: 9px;
  font-weight: 900;
}

.tab-btn.active .tab-count {
  background: rgba(26,29,22,.16);
  color: #1a1d16;
}

.following-section {
  display: grid;
  gap: 14px;
}

.following-summary {
  box-shadow: none;
}

.following-summary h3 {
  margin: 12px 0 5px;
  font-size: 20px;
}

.following-list {
  display: grid;
  gap: 10px;
}

.following-user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  transition: border-color .16s ease, transform .16s ease;
}

.following-user-card:hover {
  border-color: #5c6751;
  transform: translateY(-1px);
}

.following-user-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
  flex: 1;
}

.following-avatar {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid #59644e;
  background: linear-gradient(135deg,#687058,#3e4937);
  font-size: 14px;
  font-weight: 900;
}

.following-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.following-user-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.following-user-copy strong {
  font-size: 14px;
}

.following-user-copy small,
.following-user-copy em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.following-user-copy > span {
  max-width: 560px;
  margin: 4px 0 2px;
  color: #dfe2d5;
  font-size: 11px;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.following-unfollow-btn {
  flex: 0 0 auto;
  min-width: 102px;
}

.following-unfollow-btn:hover {
  border-color: rgba(217,141,120,.35);
  color: #efb0a0;
}

@media (max-width: 620px) {
  .profile-stats-four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .profile-stat-button {
    min-width: 0;
    padding: 11px 3px;
  }

  .profile-stat-button strong {
    font-size: 16px;
  }

  .profile-stat-button span {
    font-size: 8px;
  }

  .following-user-card {
    align-items: flex-start;
    gap: 10px;
    padding: 13px;
  }

  .following-avatar {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .following-user-copy > span {
    max-width: none;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .following-unfollow-btn {
    min-width: 0;
    padding: 8px 9px;
    font-size: 10px;
  }
}

@media (max-width: 420px) {
  .following-user-card {
    display: grid;
    grid-template-columns: 1fr;
  }

  .following-unfollow-btn {
    width: 100%;
  }
}


/* V17 — Reaction toggle state */
.reaction-btn.liked,
.detail-action.liked {
  color: #e5b4a6;
}

.reaction-btn.liked:hover,
.detail-action.liked:hover {
  color: #f0c4b8;
}


/* =========================================================
   V18 — CREATE POST: TITLE + EDITABLE TOPIC + REQUIRED TERMS
   ========================================================= */

.topic-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 2px;
}

.topic-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.025);
  color: var(--muted);
  padding: 7px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: .16s ease;
}

.topic-chip:hover,
.topic-chip.selected {
  border-color: rgba(192,168,136,.55);
  background: rgba(192,168,136,.10);
  color: var(--accent);
}

.publish-requirement {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(255,255,255,.018);
}

.publish-requirement .check-row {
  margin: 0;
}

.requirement-note {
  margin-top: 8px;
  padding-left: 26px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.requirement-note.accepted {
  color: var(--ok);
}

#publishPostBtn:disabled {
  opacity: .42;
  cursor: not-allowed;
  transform: none;
}

.preview-title,
.post-card-title {
  margin: 13px 0 7px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: -.02em;
}

.post-card-title {
  font-size: 16px;
}

@media(max-width:620px) {
  .topic-suggestions {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .topic-suggestions::-webkit-scrollbar {
    display: none;
  }

  .topic-chip {
    flex: 0 0 auto;
    min-height: 36px;
  }

  .publish-requirement {
    padding: 12px;
  }

  .preview-title,
  .post-card-title {
    font-size: 15px;
  }
}


/* V19 — penyempurnaan pembuat postingan + mode terang/gelap */
html[data-theme="light"]{
 --bg:#f3f0e7;--panel:#fbfaf5;--panel-2:#f0ede3;--soft:#e5e2d6;--border:#c9c4b3;
 --text:#22271f;--muted:#6e7465;--accent:#9a815f;--accent-2:#727b65;--olive:#d8d8c8;--sage:#89917c;
 --danger:#a95543;--ok:#61754f;--warn:#936f38;--shadow:0 18px 50px rgba(55,49,38,.10);
}
html[data-theme="light"] body{background:radial-gradient(circle at top left,rgba(154,129,95,.10),transparent 28%),radial-gradient(circle at 80% 20%,rgba(114,123,101,.08),transparent 24%),var(--bg)}
html[data-theme="light"] .topbar{background:rgba(243,240,231,.88);border-bottom-color:rgba(55,49,38,.10)}
html[data-theme="light"] .navlinks{color:#555c4e}
html[data-theme="light"] .navlinks a:hover{color:var(--text);background:rgba(0,0,0,.04)}
html[data-theme="light"] .btn{color:var(--text)}
html[data-theme="light"] select,html[data-theme="light"] input,html[data-theme="light"] textarea{background:#fffdf8;color:var(--text)}
html[data-theme="light"] .post p,html[data-theme="light"] .following-user-copy>span{color:#3c4338}
html[data-theme="light"] .navlinks.open{background:rgba(251,250,245,.98)}
.theme-toggle{width:42px;height:42px;display:grid;place-items:center;border:1px solid var(--border);border-radius:12px;background:var(--panel-2);color:var(--text);font-size:17px;line-height:1}
.compose-grid{align-items:start}
.compose-grid .field{align-self:start}
.compose-grid select,.compose-grid input{height:48px;min-height:48px;align-self:start}
.preview-post .post-top{align-items:flex-start}
.preview-post .user{min-width:0;flex:1}
.preview-post .user>div:last-child{min-width:0}
.preview-post .user-name{overflow-wrap:anywhere}
.preview-topics{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}
.preview-topics .chip{max-width:100%;overflow-wrap:anywhere}
@media(max-width:620px){.theme-toggle{width:40px;height:40px;flex:0 0 40px}.preview-topics{margin-top:10px}.compose-grid select,.compose-grid input{height:48px}}


/* =========================================================
   V20 — PERBAIKAN MODE TERANG / GELAP
   ========================================================= */

html {
  color-scheme: dark;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg:#11150f;
  --panel:#1b2118;
  --panel-2:#232a1f;
  --soft:#30382a;
  --border:#46503d;
  --text:#f0f0e0;
  --muted:#aeb49b;
  --accent:#c0a888;
  --accent-2:#889078;
  --olive:#505840;
  --sage:#687058;
  --danger:#d98d78;
  --ok:#9cad82;
  --warn:#d8bc8c;
  --shadow:0 18px 60px rgba(0,0,0,.28);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg:#eeeade;
  --panel:#faf8f1;
  --panel-2:#f1ede2;
  --soft:#e6e0d2;
  --border:#c8c0ad;
  --text:#252a20;
  --muted:#6c7264;
  --accent:#9b805d;
  --accent-2:#737d65;
  --olive:#d4d4c2;
  --sage:#879078;
  --danger:#a75443;
  --ok:#60754e;
  --warn:#8d6a35;
  --shadow:0 18px 50px rgba(63,54,40,.12);
}

body {
  transition: background-color .2s ease, color .2s ease;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left,rgba(192,168,136,.10),transparent 28%),
    radial-gradient(circle at 80% 20%,rgba(136,144,120,.08),transparent 24%),
    var(--bg);
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at top left,rgba(155,128,93,.11),transparent 28%),
    radial-gradient(circle at 80% 20%,rgba(115,125,101,.10),transparent 24%),
    var(--bg);
}

/* Komponen yang sebelumnya memiliki warna gelap hard-coded */
html[data-theme="light"] .topbar {
  background:rgba(238,234,222,.90);
  border-bottom-color:rgba(74,67,53,.13);
}

html[data-theme="light"] .hero-copy,
html[data-theme="light"] .status-card,
html[data-theme="light"] .card,
html[data-theme="light"] .live-card,
html[data-theme="light"] .post,
html[data-theme="light"] .compose-card,
html[data-theme="light"] .auth-card,
html[data-theme="light"] .profile-header-card,
html[data-theme="light"] .admin-login-card,
html[data-theme="light"] .admin-topbar,
html[data-theme="light"] .admin-stat-card,
html[data-theme="light"] .following-user-card,
html[data-theme="light"] .post-detail-dialog,
html[data-theme="light"] .post-side-card,
html[data-theme="light"] .comment-input-wrap,
html[data-theme="light"] .profile-photo-editor,
html[data-theme="light"] .publish-requirement,
html[data-theme="light"] .generator-stage {
  background-color:var(--panel);
  color:var(--text);
}

html[data-theme="light"] .post,
html[data-theme="light"] .compose-author,
html[data-theme="light"] .profile-preview,
html[data-theme="light"] .admin-result-row,
html[data-theme="light"] .admin-post-item,
html[data-theme="light"] .notification-panel {
  background:var(--panel-2);
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea,
html[data-theme="light"] .input-prefix,
html[data-theme="light"] .comment-input-wrap {
  background:#fffdf7;
  color:var(--text);
}

html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder {
  color:#8c8f82;
}

html[data-theme="light"] .btn {
  background:var(--panel-2);
  color:var(--text);
}

html[data-theme="light"] .btn-accent {
  background:var(--accent);
  border-color:var(--accent);
  color:#fffdf7;
}

html[data-theme="light"] .btn-ghost {
  background:transparent;
}

html[data-theme="light"] .navlinks {
  color:#51584b;
}

html[data-theme="light"] .navlinks.open {
  background:rgba(250,248,241,.98);
}

html[data-theme="light"] .post p,
html[data-theme="light"] .post-detail-body,
html[data-theme="light"] .comment-content p,
html[data-theme="light"] .comment-reply p,
html[data-theme="light"] .profile-main-info p,
html[data-theme="light"] .following-user-copy > span {
  color:#394035;
}

html[data-theme="light"] .chip,
html[data-theme="light"] .tab-btn,
html[data-theme="light"] .topic-chip,
html[data-theme="light"] .account-pill,
html[data-theme="light"] .notification-btn,
html[data-theme="light"] .mobile-menu-toggle,
html[data-theme="light"] .theme-toggle {
  background:#f3efe5;
  color:var(--text);
}

html[data-theme="light"] .tab-btn.active {
  background:var(--accent);
  color:#fffdf7;
}

html[data-theme="light"] .profile-cover {
  background:
    linear-gradient(130deg,rgba(155,128,93,.38),rgba(115,125,101,.36)),
    radial-gradient(circle at 15% 20%,rgba(255,255,255,.18),transparent 28%),
    #a9ad98;
}

html[data-theme="light"] .notice {
  background:rgba(155,128,93,.08);
  color:#5e533f;
}

html[data-theme="light"] footer {
  color:#74796c;
}

html[data-theme="light"] .modal-backdrop,
html[data-theme="light"] .post-detail-backdrop {
  background:rgba(45,42,34,.54);
}

/* Tombol tema */
.theme-toggle {
  width:42px;
  height:42px;
  flex:0 0 42px;
  display:grid;
  place-items:center;
  border:1px solid var(--border);
  border-radius:13px;
  background:var(--panel-2);
  color:var(--text);
  font-size:16px;
  line-height:1;
  cursor:pointer;
  transition:background .18s ease,border-color .18s ease,transform .18s ease;
}

.theme-toggle:hover {
  transform:translateY(-1px);
  border-color:#68735c;
}

@media(max-width:620px) {
  .theme-toggle {
    width:40px;
    height:40px;
    flex-basis:40px;
  }
}


/* =========================================================
   V21 — 1001 BUKU MIMPI
   ========================================================= */

.dream-hero {
  margin-bottom: 18px;
}

.dream-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, .55fr) minmax(0, 1.45fr);
  gap: 18px;
  align-items: end;
  box-shadow: none;
}

.dream-search-wrap,
.dream-range-wrap {
  display: grid;
  gap: 8px;
}

.dream-search-wrap label,
.dream-filter-label {
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.dream-range-tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.dream-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 24px 0 12px;
}

.dream-section-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.dream-section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.dream-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dream-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.dream-card:hover {
  transform: translateY(-2px);
  border-color: #67725a;
  box-shadow: var(--shadow);
}

.dream-card-button {
  width: 100%;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.dream-card-image {
  aspect-ratio: 1.24 / 1;
  overflow: hidden;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.dream-card-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top center;
}

.dream-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 13px;
}

.dream-card-footer > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.dream-card-footer span,
.dream-card-footer small {
  color: var(--muted);
  font-size: 9px;
}

.dream-card-footer strong {
  color: var(--text);
  font-size: 18px;
  letter-spacing: .03em;
}

.dream-empty {
  margin: 18px 0;
  padding: 46px 20px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 20px;
  color: var(--muted);
}

.dream-empty h3 {
  color: var(--text);
  margin: 7px 0 5px;
}

.dream-empty p {
  margin: 0;
  font-size: 11px;
}

.dream-notice {
  margin-top: 22px;
}

.dream-modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: grid;
  place-items: center;
  padding: 24px;
}

.dream-modal.hidden {
  display: none !important;
}

.dream-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3,5,3,.78);
  backdrop-filter: blur(6px);
}

.dream-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: 92dvh;
  overflow-y: auto;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 34px 120px rgba(0,0,0,.48);
}

.dream-modal-head h2 {
  margin: 12px 0 4px;
  font-size: 28px;
}

.dream-modal-head p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.dream-modal-image-wrap {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: #fff;
}

.dream-modal-image-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

.dream-modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
}

.dream-modal-actions .btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}

html[data-theme="light"] .dream-card,
html[data-theme="light"] .dream-modal-dialog {
  background: var(--panel);
}

html[data-theme="light"] .dream-card-image,
html[data-theme="light"] .dream-modal-image-wrap {
  background: #fff;
}

html[data-theme="light"] .dream-modal-backdrop {
  background: rgba(45,42,34,.58);
}

@media (max-width: 1000px) {
  .dream-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dream-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .dream-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .dream-range-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .dream-range-tabs::-webkit-scrollbar {
    display: none;
  }

  .dream-range-tabs .tab-btn {
    flex: 0 0 auto;
  }

  .dream-modal {
    padding: 0;
    align-items: end;
  }

  .dream-modal-dialog {
    width: 100%;
    max-height: 94dvh;
    padding: 18px 12px max(16px, env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
  }

  .dream-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .dream-modal-actions .btn {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .dream-card-footer {
    padding: 10px;
  }

  .dream-card-footer strong {
    font-size: 16px;
  }
}


/* =========================================================
   V22 — BUKU MIMPI: CROP PRESISI PER HALAMAN
   ========================================================= */

.dream-page-image {
  aspect-ratio: auto;
  background: #fff;
}

.dream-page-image img {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center top;
}

.dream-page-label {
  display: grid !important;
  gap: 2px !important;
}

.dream-page-label strong {
  font-size: 15px;
  letter-spacing: 0;
}

.dream-modal-image-wrap img {
  object-fit: contain;
  object-position: center top;
}

@media (min-width: 701px) {
  .dream-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .dream-card-footer {
    align-items: flex-start;
  }

  .dream-card-footer small {
    text-align: right;
    line-height: 1.35;
  }
}

/* =========================================================
   V23 — BUKU MIMPI: CARD ALIGNMENT CONSISTENCY
   Semua kartu dalam satu baris memiliki tinggi yang sama.
   Gambar tidak dipotong; ruang kosong mengisi perbedaan rasio.
   ========================================================= */
.dream-grid {
  align-items: stretch;
}

.dream-card {
  height: 100%;
}

.dream-card-button {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.dream-page-image {
  width: 100%;
  aspect-ratio: 0.70 / 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  background: #fff;
}

.dream-page-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center top;
}

.dream-card-footer {
  min-height: 72px;
  margin-top: auto;
  box-sizing: border-box;
}

.dream-page-label strong {
  line-height: 1.25;
}

@media (max-width: 700px) {
  .dream-page-image {
    aspect-ratio: 0.70 / 1;
  }

  .dream-card-footer {
    min-height: 68px;
  }
}


/* =========================================================
   V24 — HASIL 6 ANGKA + PERALATAN REFERENSI
   ========================================================= */

.result-six {
  gap: 6px;
  flex-wrap: nowrap;
}

.result-six .digit {
  min-width: 36px;
  padding-inline: 9px;
}

.result-six .digit-last-four {
  border-color: rgba(192,168,136,.48);
  background: rgba(192,168,136,.08);
}

.result-reference-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
}

.result-reference-row strong {
  color: var(--accent);
}

.latest-reference-card,
.number-builder-card {
  margin-bottom: 18px;
  box-shadow: none;
}

.latest-reference-card .tools-card-head h2,
.number-builder-card .tools-card-head h2 {
  margin: 10px 0 5px;
  font-size: 24px;
}

.latest-results-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 10px;
  margin-top: 18px;
}

.latest-result-item {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel-2);
  transition: border-color .16s ease, transform .16s ease;
}

.latest-result-item:hover {
  transform: translateY(-1px);
  border-color: #66715a;
}

.latest-result-item.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(192,168,136,.12);
}

.latest-result-head,
.latest-result-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 9px;
}

.latest-result-head > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.latest-result-head strong {
  font-size: 12px;
}

.latest-result-head span {
  color: var(--muted);
  font-size: 8px;
}

.latest-result-number {
  display: flex;
  gap: 4px;
  margin: 15px 0;
  font-variant-numeric: tabular-nums;
}

.latest-result-number > span {
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  place-items: center;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255,255,255,.022);
  font-size: 16px;
  font-weight: 900;
}

.latest-result-number > .reference-digit {
  border-color: rgba(192,168,136,.48);
  background: rgba(192,168,136,.09);
  color: var(--accent);
}

.latest-result-foot {
  align-items: center;
}

.latest-result-foot > div {
  display: grid;
  gap: 2px;
}

.latest-result-foot span {
  color: var(--muted);
  font-size: 8px;
}

.latest-result-foot strong {
  color: var(--accent);
  font-size: 15px;
  letter-spacing: .08em;
}

.use-reference-btn {
  padding: 8px 9px;
  font-size: 9px;
  white-space: nowrap;
}

.reference-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(192,168,136,.045);
}

.reference-selected > div {
  display: grid;
  gap: 3px;
}

.reference-selected span,
.reference-selected small {
  color: var(--muted);
  font-size: 9px;
}

.reference-selected strong {
  font-size: 13px;
}

.builder-input-row {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 12px;
}

.builder-options {
  margin: 4px 0 14px;
}

.compact-check {
  width: max-content;
  max-width: 100%;
}

.builder-stage {
  min-height: 190px;
}

.builder-output {
  max-height: 300px;
  overflow-y: auto;
}

.builder-summary {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -6px 0 12px;
  color: var(--muted);
  font-size: 10px;
}

.builder-summary strong {
  color: var(--text);
}

.tools-secondary-section {
  margin-top: 28px;
}

.random-generator-card {
  min-height: auto;
}

.history-reference {
  margin-top: 3px;
  color: var(--accent);
  font-size: 9px;
}

.history-values {
  line-height: 1.55;
}

html[data-theme="light"] .latest-result-item {
  background: var(--panel-2);
}

html[data-theme="light"] .latest-result-number > span {
  background: #fffaf1;
}

html[data-theme="light"] .latest-result-number > .reference-digit {
  background: rgba(155,128,93,.11);
}

@media(max-width:1000px) {
  .latest-results-grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

@media(max-width:620px) {
  .result-six {
    gap: 4px;
  }

  .result-six .digit {
    min-width: 0;
    flex: 1 1 0;
    padding: 10px 3px;
  }

  .result-reference-row {
    flex-direction: column;
  }

  .latest-results-grid {
    grid-template-columns: 1fr;
  }

  .latest-result-number > span {
    height: 44px;
    font-size: 18px;
  }

  .builder-input-row {
    grid-template-columns: 1fr;
  }

  .reference-selected {
    align-items: flex-start;
    flex-direction: column;
  }

  .reference-selected .link-button {
    min-height: 34px;
  }

  .builder-summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}


/* =========================================================
   V25 — ALIGNMENT FIX: PENYUSUN ANGKA
   Kedua field memiliki struktur dan tinggi yang konsisten.
   ========================================================= */

.builder-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 220px);
  gap: 12px;
  align-items: start;
}

.builder-input-row > .field {
  display: grid;
  grid-template-rows: auto 62px auto;
  align-content: start;
  min-width: 0;
}

.builder-input-row > .field label {
  align-self: end;
  margin-bottom: 7px;
}

.builder-input-row > .field input,
.builder-input-row > .field select {
  width: 100%;
  height: 62px;
  min-height: 62px;
  margin: 0;
}

.builder-input-row > .field .input-rule {
  min-height: 28px;
  margin-top: 7px;
  line-height: 1.4;
}

/* Kolom jenis kombinasi tidak memiliki helper text,
   tetapi spacer menjaga baseline bagian berikutnya tetap sejajar. */
.builder-input-row > .field:last-child::after {
  content: "";
  display: block;
  min-height: 28px;
  margin-top: 7px;
}

@media (max-width: 620px) {
  .builder-input-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .builder-input-row > .field {
    grid-template-rows: auto 54px auto;
  }

  .builder-input-row > .field input,
  .builder-input-row > .field select {
    height: 54px;
    min-height: 54px;
  }

  .builder-input-row > .field:last-child::after {
    display: none;
  }
}

/* =========================================================
   V26 — JADWAL PASARAN + MENUNGGU UPDATE ADMIN
   ========================================================= */
.waiting-result-box {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 5px;
  margin-top: 18px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: rgba(192,168,136,.035);
}
.waiting-result-box strong { color: var(--text); font-size: 14px; }
.waiting-result-box span { color: var(--muted); font-size: 10px; line-height: 1.5; }
.live-published-time { margin-top: 7px; }


/* =========================================================
   V28 — NOTIFIKASI FOLLOW SEKALI TAMPIL
   ========================================================= */

.follow-once-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(192,168,136,.35);
  border-radius: 14px;
  background: rgba(192,168,136,.08);
}

.follow-once-notice strong {
  color: var(--text);
  font-size: 12px;
}

.follow-once-notice span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

html[data-theme="light"] .follow-once-notice {
  background: rgba(155,128,93,.08);
}

@media (max-width: 620px) {
  .follow-once-notice {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}


/* =========================================================
   V29 — INDIKATOR FOLLOW BARU: HILANG SETELAH DILIHAT
   ========================================================= */

.following-summary-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.following-new-indicator {
  display: inline-grid;
  place-items: center;
  min-height: 27px;
  padding: 0 9px;
  border: 1px solid rgba(192,168,136,.36);
  border-radius: 999px;
  background: rgba(192,168,136,.10);
  color: var(--accent);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .02em;
}

html[data-theme="light"] .following-new-indicator {
  background: rgba(155,128,93,.09);
}

#followingTabCount.hidden {
  display: none !important;
}


/* =========================================================
   V30 — POPUP DAFTAR MENGIKUTI DARI STATISTIK PROFIL
   ========================================================= */

.following-popup {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 22px;
}

.following-popup.hidden {
  display: none !important;
}

.following-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3,5,3,.78);
  backdrop-filter: blur(6px);
}

.following-popup-dialog {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  max-height: min(78dvh, 760px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 34px 120px rgba(0,0,0,.48);
}

.following-popup-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.following-popup-head h2 {
  margin: 11px 0 4px;
  font-size: 24px;
  letter-spacing: -.03em;
}

.following-popup-head p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.following-popup-list {
  min-height: 140px;
  overflow-y: auto;
  display: grid;
  gap: 9px;
  padding: 14px;
}

.following-popup-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--panel-2);
}

.following-popup-user-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.following-popup-avatar {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #59644e;
  border-radius: 15px;
  background: linear-gradient(135deg,#687058,#3e4937);
  font-size: 13px;
  font-weight: 900;
}

.following-popup-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.following-popup-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.following-popup-copy strong {
  font-size: 13px;
}

.following-popup-copy small,
.following-popup-copy em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.following-popup-copy > span {
  max-width: 350px;
  margin-top: 3px;
  overflow: hidden;
  color: #dfe2d5;
  font-size: 10px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.following-popup-visit {
  flex: 0 0 auto;
  white-space: nowrap;
}

.following-popup-empty {
  padding: 34px 16px;
  text-align: center;
}

.following-popup-empty h3 {
  margin: 8px 0 5px;
}

.following-popup-empty p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 11px;
}

html[data-theme="light"] .following-popup-dialog {
  background: var(--panel);
}

html[data-theme="light"] .following-popup-user {
  background: var(--panel-2);
}

html[data-theme="light"] .following-popup-backdrop {
  background: rgba(45,42,34,.58);
}

html[data-theme="light"] .following-popup-copy > span {
  color: #394035;
}

@media(max-width:620px) {
  .following-popup {
    padding: 0;
    align-items: end;
  }

  .following-popup-dialog {
    width: 100%;
    max-height: 88dvh;
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
  }

  .following-popup-head {
    padding: 17px 14px 13px;
  }

  .following-popup-head h2 {
    font-size: 20px;
  }

  .following-popup-list {
    padding: 10px;
  }

  .following-popup-user {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .following-popup-copy > span {
    max-width: none;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .following-popup-visit {
    width: 100%;
    text-align: center;
  }
}


/* =========================================================
   V31 — PERALATAN SEBAGAI DASHBOARD + WORKSPACE
   ========================================================= */

.tools-workspace-page .latest-reference-card {
  margin-bottom: 22px;
}

.tools-summary-section {
  margin-bottom: 22px;
}

.tool-summary-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 12px;
}

.tool-summary-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  transition: border-color .16s ease, transform .16s ease, background .16s ease;
  cursor: pointer;
}

.tool-summary-card:hover,
.tool-summary-card.active {
  border-color: rgba(192,168,136,.60);
  transform: translateY(-1px);
}

.tool-summary-card.active {
  background: rgba(192,168,136,.055);
}

.tool-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.tool-summary-kicker {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.tool-summary-head h3 {
  margin: 6px 0 0;
  font-size: 16px;
  line-height: 1.3;
}

.tool-summary-open {
  flex: 0 0 auto;
  padding: 8px 10px;
  font-size: 10px;
}

.tool-summary-body {
  min-height: 72px;
  display: grid;
  align-content: start;
  gap: 6px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.summary-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.summary-line span {
  color: var(--muted);
}

.summary-line strong {
  min-width: 0;
  color: var(--text);
  font-size: 10px;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-result {
  margin-top: 3px;
  padding-top: 7px;
  border-top: 1px solid rgba(255,255,255,.055);
  color: var(--accent);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.summary-final {
  font-size: 13px;
}

.tools-workspace-card {
  margin-bottom: 20px;
  padding: 20px;
  box-shadow: none;
  scroll-margin-top: 90px;
}

.workspace-head {
  display: grid;
  grid-template-columns: minmax(0,1fr) 290px;
  align-items: end;
  gap: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.workspace-head h2 {
  margin: 11px 0 5px;
  font-size: 25px;
}

.workspace-head p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.workspace-selector {
  margin: 0;
}

.workspace-panel {
  padding-top: 20px;
}

.olah-intro {
  margin-bottom: 16px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(192,168,136,.045);
}

.olah-intro > div {
  display: grid;
  gap: 4px;
}

.olah-intro strong {
  font-size: 12px;
}

.olah-intro span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.olah-form-grid {
  display: grid;
  grid-template-columns: 220px minmax(0,1fr);
  gap: 12px;
}

.olah-result-stage {
  min-height: 220px;
  margin: 18px 0 14px;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: 17px;
  background: rgba(255,255,255,.012);
}

.olah-result {
  display: grid;
  gap: 15px;
}

.olah-block {
  display: grid;
  gap: 8px;
}

.olah-block > span,
.olah-final > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.olah-digits {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.olah-digits > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  font-weight: 900;
}

.olah-steps {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 8px;
}

.olah-step {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
  text-align: center;
}

.olah-step span {
  color: var(--muted);
  font-size: 9px;
}

.olah-step strong {
  font-size: 12px;
}

.olah-final {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(192,168,136,.38);
  border-radius: 14px;
  background: rgba(192,168,136,.075);
}

.olah-final strong {
  font-size: 30px;
  color: var(--accent);
}

.tools-history-card {
  margin-bottom: 18px;
  box-shadow: none;
}

html[data-theme="light"] .tool-summary-card,
html[data-theme="light"] .tools-workspace-card,
html[data-theme="light"] .tools-history-card {
  background: var(--panel);
}

html[data-theme="light"] .olah-step,
html[data-theme="light"] .olah-digits > span {
  background: var(--panel-2);
}

html[data-theme="light"] .summary-result {
  border-top-color: rgba(45,42,34,.08);
}

@media(max-width:900px) {
  .tool-summary-grid {
    grid-template-columns: 1fr;
  }

  .workspace-head {
    grid-template-columns: 1fr;
  }

  .workspace-selector {
    max-width: none;
  }

  .olah-steps {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
}

@media(max-width:620px) {
  .tool-summary-card {
    padding: 13px;
  }

  .tool-summary-body {
    min-height: 0;
  }

  .tools-workspace-card {
    padding: 14px;
  }

  .workspace-head h2 {
    font-size: 21px;
  }

  .olah-form-grid {
    grid-template-columns: 1fr;
  }

  .olah-steps {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .olah-final strong {
    font-size: 26px;
  }
}

/* V31.1 — rapikan badge Data Live pada header Hasil Pasaran */
.latest-reference-card .tools-card-head > .chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  width:max-content;
  max-width:none;
  white-space:nowrap;
  word-break:normal;
  overflow-wrap:normal;
  line-height:1;
  padding:9px 12px;
}

@media(max-width:620px){
  .latest-reference-card .tools-card-head{
    align-items:flex-start;
  }
  .latest-reference-card .tools-card-head > .chip{
    font-size:10px;
    padding:8px 10px;
  }
}

/* V31.2 — age gate 21+ */
body.age-gate-open{
  overflow:hidden;
}

.age-gate{
  position:fixed;
  inset:0;
  z-index:9999;
  display:grid;
  place-items:center;
  padding:20px;
}

.age-gate-backdrop{
  position:absolute;
  inset:0;
  background:rgba(8,10,7,.88);
  backdrop-filter:blur(12px);
}

.age-gate-card{
  position:relative;
  width:min(100%,520px);
  padding:30px;
  border:1px solid rgba(192,168,136,.34);
  border-radius:22px;
  background:var(--panel);
  box-shadow:0 30px 90px rgba(0,0,0,.42);
}

.age-gate-badge{
  width:58px;
  height:58px;
  display:grid;
  place-items:center;
  margin-bottom:20px;
  border:1px solid rgba(192,168,136,.48);
  border-radius:50%;
  color:var(--accent);
  background:rgba(192,168,136,.08);
  font-size:20px;
  font-weight:900;
}

.age-gate-card h2{
  margin:10px 0;
  font-size:28px;
  line-height:1.2;
}

.age-gate-card p{
  margin:0;
  color:var(--muted);
  font-size:13px;
  line-height:1.7;
}

.age-gate-actions{
  display:flex;
  gap:10px;
  margin-top:24px;
}

html[data-theme="light"] .age-gate-backdrop{
  background:rgba(35,37,31,.72);
}

@media(max-width:620px){
  .age-gate{
    align-items:end;
    padding:10px;
  }

  .age-gate-card{
    padding:22px 18px;
    border-radius:20px;
  }

  .age-gate-card h2{
    font-size:23px;
  }

  .age-gate-actions{
    flex-direction:column;
  }

  .age-gate-actions .btn{
    width:100%;
  }
}

.beta-pill{display:inline-flex;align-items:center;padding:5px 8px;margin-left:7px;border:1px solid rgba(192,168,136,.32);border-radius:999px;color:var(--accent);font-size:9px;font-weight:900;letter-spacing:.06em;vertical-align:middle}.server-setup-warning{width:min(calc(100% - 32px),var(--max));margin:14px auto 0;padding:12px 14px;border:1px solid rgba(217,141,120,.35);border-radius:13px;background:rgba(217,141,120,.08);color:var(--text);font-size:11px}
