* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background: #f0fdfa;
  color: #134e4a;
  min-height: 100vh;
}
header {
  background: #0f766e;
  color: #fff;
  padding: 18px 16px 14px;
  text-align: center;
}
header h1 { font-size: 1.5rem; }
header .sub { font-size: 0.9rem; opacity: 0.9; margin-top: 4px; }
main { max-width: 640px; margin: 0 auto; padding: 12px 14px 90px; }
section { margin-bottom: 22px; }
h2 { font-size: 1.05rem; margin-bottom: 10px; }
.hidden { display: none !important; }

.banner {
  background: #fef3c7;
  color: #92400e;
  padding: 10px 14px;
  font-size: 0.9rem;
  text-align: center;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: #fff;
  border: 1.5px solid #0f766e;
  color: #0f766e;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.9rem;
  cursor: pointer;
}
.chip:active { background: #0f766e; color: #fff; }

.messages {
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  min-height: 180px;
  max-height: 46vh;
  overflow-y: auto;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.msg { margin-bottom: 10px; max-width: 88%; }
.msg.user { margin-inline-start: auto; text-align: left; }
.bubble {
  display: inline-block;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.5;
}
.msg.user .bubble { background: #ccfbf1; }
.msg.tutor .bubble { background: #f1f5f9; }
.bubble .en { display: block; direction: ltr; text-align: left; font-weight: 600; }
.bubble .ar { display: block; margin-top: 4px; color: #475569; font-size: 0.88rem; }
.bubble-actions { margin-top: 4px; }
.replay {
  background: none; border: none; font-size: 1rem; cursor: pointer; opacity: 0.7;
}

.talk-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.mic {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: none;
  background: #0f766e;
  color: #fff;
  font-size: 1.7rem;
  cursor: pointer;
  flex-shrink: 0;
}
.mic.listening { background: #dc2626; animation: pulse 1.2s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(220,38,38,0.5); }
  70% { box-shadow: 0 0 0 14px rgba(220,38,38,0); }
  100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); }
}
.talk-side { flex: 1; }
.status { font-size: 0.8rem; color: #64748b; margin-bottom: 6px; min-height: 1.1em; }
#text-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #99f6e4;
  border-radius: 10px;
  font-size: 0.95rem;
}
.send {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: #0f766e;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
}

.lesson {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.lesson h3 { font-size: 0.98rem; margin-bottom: 8px; }
.phrase {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid #f1f5f9;
  flex-wrap: wrap;
}
.phrase .txt { flex: 1; min-width: 150px; }
.phrase .en { direction: ltr; text-align: left; font-weight: 600; display: block; }
.phrase .ar { font-size: 0.85rem; color: #64748b; }
.phrase button {
  border: 1px solid #0f766e;
  background: #fff;
  color: #0f766e;
  border-radius: 8px;
  padding: 5px 9px;
  font-size: 0.82rem;
  cursor: pointer;
}
.phrase .result { font-size: 0.82rem; width: 100%; }

footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 10px;
  text-align: center;
  background: linear-gradient(transparent, #f0fdfa 40%);
}
#install-btn {
  background: #0f766e; color: #fff;
  border: none; border-radius: 999px;
  padding: 12px 22px; font-size: 1rem; cursor: pointer;
  box-shadow: 0 2px 8px rgba(15,118,110,0.4);
}
