.eulogy-app {
  max-width: 620px;
  margin: 0 auto;
  padding: 24px 16px 48px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1a1a1a;
  line-height: 1.6;
}

.form-wrap h1 {
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 4px;
  color: #1a1a1a;
}

.intro {
  color: #555;
  margin: 0 0 28px;
  font-size: 15px;
}

.ctrl {
  margin-bottom: 18px;
  position: relative;
}

.ctrl label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  color: #333;
}

.ctrl .opt {
  font-weight: 400;
  color: #888;
}

.ctrl input[type="text"],
.ctrl textarea,
.ctrl select {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  color: #1a1a1a;
  box-sizing: border-box;
  font-family: inherit;
}

.ctrl input[type="text"]:focus,
.ctrl textarea:focus,
.ctrl select:focus {
  outline: none;
  border-color: #3b4a5c;
  box-shadow: 0 0 0 2px rgba(59, 74, 92, 0.15);
}

.ctrl textarea {
  resize: vertical;
  min-height: 60px;
}

.char-count {
  display: block;
  text-align: right;
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}

.ctrl-row {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.ctrl-row .ctrl {
  flex: 1;
  margin-bottom: 0;
}

.ai-note {
  font-size: 13px;
  color: #777;
  margin: 0 0 20px;
  line-height: 1.5;
}

.btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.15s;
}

.btn-primary {
  background: #3b4a5c;
  color: #fff;
}

.btn-primary:hover {
  background: #2d3a4a;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: #e8eaed;
  color: #333;
}

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

.btn-block {
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.err {
  color: #b3261e;
  font-size: 14px;
  margin-top: 8px;
}

/* Writing state */
.writing-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.writing-inner {
  text-align: center;
}

.writing-inner p {
  color: #555;
  font-size: 16px;
  margin-top: 16px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #ddd;
  border-top-color: #3b4a5c;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Preview state */
.preview-wrap {
  text-align: center;
  padding-top: 8px;
}

.preview-wrap h1 {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 16px;
}

.pv-text {
  text-align: left;
  font-size: 16px;
  line-height: 1.7;
  color: #1a1a1a;
  margin-bottom: 0;
}

.pv-text p {
  margin: 0 0 12px;
}

.pv-fade {
  height: 60px;
  background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1));
  margin-top: -60px;
  position: relative;
  z-index: 1;
}

.pv-placeholder {
  padding: 0 0 20px;
}

.ph-line {
  height: 12px;
  background: #e8eaed;
  border-radius: 4px;
  margin-bottom: 10px;
}

.ph-line.short {
  width: 60%;
}

.ph-line.med {
  width: 80%;
}

.pv-time {
  font-size: 14px;
  color: #777;
  margin: 0 0 20px;
}

.change-link {
  display: inline-block;
  color: #555;
  font-size: 14px;
  margin-top: 12px;
  text-decoration: none;
}

.change-link:hover {
  text-decoration: underline;
}

/* Order page */
.order {
  padding-top: 8px;
}

.order-top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.dl-small {
  font-size: 14px;
  color: #3b4a5c;
  text-decoration: none;
}

.dl-small:hover {
  text-decoration: underline;
}

.another-link {
  font-size: 14px;
  color: #777;
  text-decoration: none;
}

.another-link:hover {
  text-decoration: underline;
}

.order h1 {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 4px;
}

.order-time {
  font-size: 14px;
  color: #777;
  margin: 0 0 20px;
}

.order-text {
  font-size: 17px;
  line-height: 1.8;
  margin-bottom: 24px;
}

.order-text p {
  margin: 0 0 16px;
}

.sent {
  font-size: 13px;
  color: #888;
  margin-top: 32px;
  text-align: center;
}

/* Edit and rewrite */
.edit-section,
.rewrite-section {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid #e8eaed;
}

.edit-section h2,
.rewrite-section h2 {
  font-size: 18px;
  margin: 0 0 4px;
}

.edit-hint,
.rewrite-hint {
  font-size: 14px;
  color: #666;
  margin: 0 0 12px;
}

.edit-status {
  font-size: 14px;
  margin-top: 8px;
}

/* Paywall */
.eulogy-pay {
  max-width: 820px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.eulogy-back {
  display: inline-block;
  color: #555;
  font-size: 14px;
  margin-bottom: 16px;
  text-decoration: none;
}

.eulogy-back:hover {
  text-decoration: underline;
}

.pay-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

.pay-art h1 {
  font-size: 22px;
  margin: 0 0 12px;
}

.pay-excerpt {
  font-size: 16px;
  line-height: 1.7;
  color: #333;
}

.pay-price {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 16px;
}

.pay-price b {
  font-size: 20px;
}

.pay-mail {
  font-size: 13px;
  color: #888;
  margin: 4px 0 0;
}

@media (max-width: 700px) {
  .pay-grid {
    grid-template-columns: 1fr;
  }
  .pay-art {
    display: none;
  }
  .eulogy-pay {
    padding: 12px 16px 48px;
  }
}
.rewrite-section textarea{display:block;box-sizing:border-box;width:100%;min-height:84px;margin-bottom:10px}
