* {
  box-sizing: border-box;
}

.app {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  touch-action: manipulation;
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  position: relative;
}

#inputText,
#outputText {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}

body {
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f4f3ef;
  margin: 0;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 4px;
}

.logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

h1 {
  font-size: 22px;
  margin: 0;
  color: #1a1a1a;
}

.subtitle {
  font-size: 14px;
  color: #6b6b6b;
  margin: 0 0 20px;
  text-align: center;
}

.lang-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

select {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 16px;
  background: white;
}

#swapBtn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: white;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.box {
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fafafa;
}

textarea {
  width: 100%;
  border: none;
  background: transparent;
  resize: none;
  font-size: 16px;
  outline: none;
  font-family: inherit;
  max-height: 120px;
  overflow-y: auto;
}

.box-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.box-actions button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: white;
  cursor: pointer;
  font-size: 15px;
}

#micBtn.listening {
  background: #e74c3c;
  border-color: #e74c3c;
}

.primary-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: #1a1a1a;
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
}

.primary-btn:hover {
  background: #333;
}

.auth-input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  font-size: 16px;
  margin-bottom: 10px;
  font-family: inherit;
}

.password-wrapper {
  position: relative;
}

.password-wrapper .auth-input {
  padding-right: 40px;
}

.peek-btn {
  position: absolute;
  right: 4px;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 8px;
  color: #6b6b6b;
}

.peek-btn:hover {
  color: #1a1a1a;
}

.peek-btn svg {
  width: 19px;
  height: 19px;
  display: block;
}

.secondary-btn {
  background: white;
  color: #1a1a1a;
  border: 1px solid #ddd;
}

.secondary-btn:hover {
  background: #f4f3ef;
}

.logout-link {
  display: block;
  margin: 12px auto 0;
  background: none;
  border: none;
  color: #6b6b6b;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px;
}

.error {
  color: #c0392b;
  font-size: 13px;
  margin: 0 0 8px;
  display: none;
}

.success {
  color: #1e7a4a;
  font-size: 13px;
  margin: 0 0 8px;
}

.output-box {
  background: #f0f7f4;
  border-color: #cfe8dd;
  max-height: 160px;
  overflow-y: auto;
}

.placeholder {
  color: #999;
}

#outputText {
  margin: 0;
  font-size: 15px;
  color: #1a1a1a;
}

.quality-label {
  display: block;
  font-size: 11px;
  color: #a67c00;
  background: #fff6e0;
  border-radius: 6px;
  padding: 2px 8px;
  margin-top: 6px;
  width: fit-content;
}

/* Shown when a cross-check against a second translation source found a
   real mismatch for this specific translation - a stronger signal than
   the generic "beta language" note, so it gets a more attention-getting
   color. */
.quality-label.unconfirmed {
  color: #a3320b;
  background: #fdece4;
}

/* --- Subscription banner (top of appScreen) --- */
.sub-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #f0f7f4;
  border: 1px solid #cfe8dd;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
  font-size: 13px;
}

.sub-banner.sub-inactive {
  background: #fff6e0;
  border-color: #f1e0a6;
}

.sub-banner-text {
  color: #1a1a1a;
}

.sub-banner-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  background: #1a1a1a;
  color: white;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.sub-banner-btn:hover {
  background: #333;
}

/* --- Subscription modal --- */
.sub-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 10;
}

.sub-modal {
  background: white;
  border-radius: 14px;
  padding: 20px;
  max-width: 340px;
  width: 100%;
  text-align: center;
}

.sub-modal h2 {
  margin: 0 0 6px;
  font-size: 17px;
}

.sub-modal p {
  margin: 0 0 14px;
  font-size: 13px;
  color: #6b6b6b;
}

.paywall-block {
  max-width: none;
  margin: 20px 0;
}
