:root{
  --bg:#0b0b0d;
  --panel:#0f1113;
  --muted:#9aa0a6;
  --text:#e6e7e9;
  --accent:#32d1a3;
  --glass: rgba(255,255,255,0.03);
  --radius:14px;
  --shadow: 0 4px 18px rgba(0,0,0,0.6);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

*{box-sizing:border-box}
html,body,#app{height:100%}
body{
  margin:0;
  background:linear-gradient(180deg, rgba(255,255,255,0.02), transparent), var(--bg);
  color:var(--text);
  display:flex;
  align-items:stretch;
  justify-content:center;
  padding:18px;
}

/* Mobile-optimized single-screen layout (no vertical scroll) */
#app{
  width:100%;
  max-width:820px;
  height:calc(100vh - 36px);
  display:flex;
  flex-direction:column;
  gap:10px;
}

/* Top bar */
.topbar{
  height:56px;
  background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 12px;
  box-shadow:var(--shadow);
  backdrop-filter: blur(8px);
}
.top-left, .top-right{display:flex; align-items:center; gap:8px}
.title{
  font-weight:600;
  font-size:16px;
  text-align:center;
  color:var(--text);
  flex:1;
  user-select:none;
}

/* main editor sheet */
.sheet{
  flex:1;
  background:linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.005));
  border-radius:12px;
  padding:12px;
  box-shadow:var(--shadow);
  display:flex;
  min-height:0; /* allow textarea to shrink */
}
#editor{
  width:100%;
  height:100%;
  resize:none;
  background:transparent;
  color:var(--text);
  border: none;
  outline: none;
  font-size:16px;
  line-height:1.5;
  caret-color:var(--accent);
  padding:8px;
}

/* toolbar */
.toolbar{
  height:68px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.btn{
  min-height:44px;
  border-radius:12px;
  padding:10px 14px;
  border: none;
  cursor:pointer;
  font-weight:600;
  font-size:15px;
}
.btn{
  background:var(--glass);
  color:var(--text);
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset;
  border:1px solid rgba(255,255,255,0.03);
}
.btn.subtle{
  background:transparent;
  color:var(--muted);
  border:1px dashed rgba(255,255,255,0.02);
}


/* icon button in topbar */
.icon-btn{
  height:44px;
  padding:8px 10px;
  border-radius:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  background:transparent;
  border:1px solid rgba(255,255,255,0.03);
  color:var(--muted);
  min-width:56px;
}
/* small text label next to icons */
.icon-btn .btn-label{
  font-size:12px;
  font-weight:600;
  color:var(--text);
  user-select:none;
}

/* touch sizes */
button{touch-action:manipulation}

/* placeholder style */
#editor::placeholder{ color: rgba(230,231,233,0.35) }

/* responsive tweaks */
@media (min-width:800px){
  #app{height:740px}
}