label {
  display: block;
  margin: 14px 0 7px;
  color: #d8d8d8;
  font-size: 13px;
  font-weight: 800;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050505;
  color: var(--text);
  outline: none;
}

input, select { min-height: 44px; padding: 0 14px; }
textarea { min-height: 120px; padding: 12px 14px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { border-color: #666; }

h1 { margin: 0; }
.muted { color: var(--muted); font-size: 13px; }
.requiredMark { color: var(--accent); margin-right: 3px; }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 5px;
  background: #262a30;
  color: #dfe7f5;
  font-size: 11px;
  font-weight: 900;
}

.api-row {
  display: grid;
  grid-template-columns: minmax(110px, 160px) minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}
.api-row label { margin: 0; color: #b9c8ff; }

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 12px;
}
.section-title h2 { margin: 0; font-size: 20px; }
.section-title span { color: var(--muted); font-size: 13px; }
.story-card { cursor: pointer; }
.story-card img, .story-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.story-body h3 { margin: 8px 0 6px; font-size: 16px; line-height: 1.35; }
.story-body p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.library-section.is-locked .library-grid { filter: blur(5px); pointer-events: none; user-select: none; opacity: .55; }

.my-work-list { display: grid; gap: 0; }
.my-work-row:hover { background: #111; }
.my-work-row .story-cover { margin: 0; cursor: pointer; }

.fieldHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 8px;
}
.fieldHeader label { margin: 0; }
.tokenInput { width: 96px; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.form-section .panel { border-color: #2a2a2a; }

.modal {
  width: min(100%, 540px);
  max-height: calc(100vh - 44px);
  overflow: auto;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  background: #20201f;
  padding: 22px;
  box-shadow: 0 24px 80px rgba(0,0,0,.65);
}
.modal form { display: grid; gap: 10px; }
.modal .check-row input { width: auto; min-height: auto; }
.profile-menu.floating.open { display: grid; gap: 10px; }

.signup-form { gap: 12px !important; }
.signup-grid { display: grid; gap: 10px; }
.signup-field label { margin: 0 0 6px; font-size: 12px; color: #cfcfcf; }
.signup-field input { min-height: 42px; }
.email-code-row { display: grid; grid-template-columns: minmax(0, 1fr) 126px; gap: 8px; }
.email-code-row .button { min-height: 42px; padding: 0 10px; white-space: nowrap; }
.signup-status { margin: 6px 0 0; min-height: 18px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.signup-status.ok { color: #7ee0a1; }
.password-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 42px; border: 1px solid var(--line); border-radius: 8px; background: #050505; }
.password-wrap:focus-within { border-color: #666; }
.password-wrap input { border: 0; min-width: 0; }
.password-eye { border: 0; background: transparent; color: #aaa; font-size: 15px; }
.password-eye.active { color: #fff; }
.terms-box { display: grid; gap: 8px; margin-top: 4px; }
.terms-box .check-row { min-height: 36px; padding: 0 10px; }
.terms-detail {
  max-height: 128px;
  overflow: auto;
  margin: -2px 0 6px 28px;
  padding: 10px 12px;
  border: 1px solid #303030;
  border-radius: 8px;
  background: #171717;
  color: var(--muted);
}
.terms-detail h4 { margin: 0 0 7px; color: #e9e9e9; font-size: 12px; }
.terms-detail ul { display: grid; gap: 6px; margin: 0; padding-left: 16px; }
.terms-detail li { font-size: 11px; line-height: 1.5; }

.chat-main, .chat-side { min-height: 0; }
.chat-page { grid-template-columns: minmax(0, 1fr) 280px; grid-template-rows: 1fr; }
.chat-main { display: grid; place-items: center; }
.chat-placeholder { text-align: center; color: var(--muted); }
.chat-side { border-left: 1px solid var(--line); padding: 20px; display: grid; align-content: start; gap: 10px; }

@media (max-width: 900px) {
  .api-row { grid-template-columns: 1fr; }
  .three { grid-template-columns: 1fr; }
  .chat-page { grid-template-columns: 1fr; }
  .chat-side { display: none; }
}

@media (max-width: 560px) {
  .email-code-row { grid-template-columns: 1fr; }
  .terms-detail { margin-left: 0; }
}
