.account-hero {
  background:
    radial-gradient(circle at 12% 16%, rgba(31, 113, 221, 0.17), transparent 34%),
    radial-gradient(circle at 80% 8%, rgba(255, 142, 69, 0.17), transparent 30%),
    rgba(255, 255, 255, 0.88);
}

.account-layout {
  margin-top: 16px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-stack {
  display: grid;
  gap: 10px;
}

.form-stack label {
  display: grid;
  gap: 4px;
}

.form-stack span {
  color: #2d4f78;
  font-size: 0.85rem;
  font-weight: 600;
}

.form-stack input {
  width: 100%;
  border: 1px solid rgba(24, 36, 63, 0.2);
  border-radius: 10px;
  padding: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  background: rgba(255, 255, 255, 0.92);
}

.form-stack textarea,
.form-stack select {
  width: 100%;
  border: 1px solid rgba(24, 36, 63, 0.2);
  border-radius: 10px;
  padding: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  background: rgba(255, 255, 255, 0.92);
}

.form-stack textarea {
  resize: vertical;
}

.form-stack input:focus,
.form-stack textarea:focus,
.form-stack select:focus {
  border-color: rgba(31, 113, 221, 0.5);
  box-shadow: 0 0 0 3px rgba(31, 113, 221, 0.12);
}

.session-auth-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  border: 1px solid rgba(24, 36, 63, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  padding: 10px;
}

.session-auth-text {
  margin: 0;
  color: #2f4f78;
  font-weight: 600;
  line-height: 1.5;
}

#logout-btn {
  margin: 0;
  white-space: nowrap;
}

.status-block {
  margin: 0;
  min-height: 120px;
  border-radius: 10px;
  border: 1px solid rgba(24, 36, 63, 0.16);
  background: rgba(255, 255, 255, 0.85);
  padding: 10px;
  color: #223956;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8rem;
}

.status-tip {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.status-tip code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.78rem;
  color: #264a78;
}

.model-form {
  margin-top: 10px;
}

#refresh-models-btn {
  margin-top: 10px;
}

.admin-area {
  margin-top: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ai-usage-toolbar {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.ai-usage-toolbar label {
  display: grid;
  gap: 4px;
}

.ai-usage-toolbar span {
  color: #2d4f78;
  font-size: 0.82rem;
  font-weight: 600;
}

.ai-usage-toolbar input[type="date"] {
  border: 1px solid rgba(24, 36, 63, 0.2);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  font-family: inherit;
}

.ai-trend-toolbar {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
}

.ai-trend-toolbar label {
  display: grid;
  gap: 4px;
}

.ai-trend-toolbar span {
  color: #2d4f78;
  font-size: 0.82rem;
  font-weight: 600;
}

.ai-trend-toolbar input[type="date"],
.ai-trend-toolbar select {
  border: 1px solid rgba(24, 36, 63, 0.2);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  font-family: inherit;
}

.trend-canvas-wrap {
  margin-top: 10px;
  border: 1px solid rgba(24, 36, 63, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.85);
  padding: 8px;
}

.trend-canvas-wrap canvas {
  width: 100%;
  height: 280px;
  display: block;
}

.blog-toolbar {
  margin-top: 10px;
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
}

.blog-toolbar label {
  display: grid;
  gap: 4px;
}

.blog-toolbar span {
  color: #2d4f78;
  font-size: 0.82rem;
  font-weight: 600;
}

.blog-toolbar select {
  border: 1px solid rgba(24, 36, 63, 0.2);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  font-family: inherit;
}

.blog-admin-panel {
  grid-column: 1 / -1;
}

.blog-admin-shell {
  margin-top: 10px;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(300px, 1fr) minmax(460px, 1.4fr);
  align-items: start;
}

.blog-list-section,
.blog-editor-section {
  border: 1px solid rgba(24, 36, 63, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  padding: 12px;
}

.blog-list-section .table-wrap {
  margin-top: 8px;
}

.blog-list-section .table-wrap table {
  min-width: 780px;
}

.blog-editing-banner {
  border: 1px solid rgba(31, 113, 221, 0.24);
  border-radius: 10px;
  background: rgba(31, 113, 221, 0.1);
  color: #1c4d8c;
  font-weight: 700;
  padding: 8px 10px;
}

.blog-preview-link {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  color: #1f5fad;
  text-decoration: none;
  font-weight: 600;
}

.blog-preview-link:hover {
  text-decoration: underline;
}

.blog-post-form {
  margin-top: 10px;
  display: grid;
  gap: 12px;
}

.blog-fieldset {
  margin: 0;
  border: 1px solid rgba(24, 36, 63, 0.12);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.85);
}

.blog-fieldset legend {
  color: #2a4f7d;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0 4px;
}

.blog-form-grid {
  display: grid;
  gap: 10px;
}

.blog-form-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.blog-post-form .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.blog-post-form .field.full {
  grid-column: 1 / -1;
}

.blog-post-form .field span {
  color: #2d4f78;
  font-size: 0.85rem;
  font-weight: 600;
}

.blog-post-form .field input,
.blog-post-form .field textarea,
.blog-post-form .field select {
  width: 100%;
  border: 1px solid rgba(24, 36, 63, 0.2);
  border-radius: 10px;
  padding: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  background: rgba(255, 255, 255, 0.92);
}

.blog-post-form .field textarea {
  resize: vertical;
}

.blog-post-form .field input:focus,
.blog-post-form .field textarea:focus,
.blog-post-form .field select:focus {
  border-color: rgba(31, 113, 221, 0.5);
  box-shadow: 0 0 0 3px rgba(31, 113, 221, 0.12);
}

.blog-upload-box {
  border: 1px dashed rgba(24, 36, 63, 0.26);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.blog-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.blog-post-admin-row.is-editing td {
  background: rgba(31, 113, 221, 0.08);
}

.hidden {
  display: none;
}

.table-wrap {
  margin-top: 10px;
  overflow: auto;
  border: 1px solid rgba(24, 36, 63, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.85);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1180px;
}

.table-wrap th,
.table-wrap td {
  border-bottom: 1px solid rgba(24, 36, 63, 0.1);
  padding: 8px;
  text-align: left;
  font-size: 0.82rem;
  color: #233a58;
}

.table-wrap th {
  background: rgba(31, 113, 221, 0.08);
  color: #1c4f89;
  font-weight: 700;
}

.table-wrap tr:last-child td {
  border-bottom: 0;
}

.table-wrap td input {
  width: 100%;
  border: 1px solid rgba(24, 36, 63, 0.16);
  border-radius: 6px;
  padding: 5px 6px;
  font-size: 0.8rem;
  font-family: inherit;
}

.blog-thumb {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}

.wide-col {
  min-width: 260px;
  max-width: 520px;
}

.inline-btn {
  border: 1px solid rgba(24, 36, 63, 0.16);
  border-radius: 8px;
  padding: 5px 8px;
  background: #fff;
  cursor: pointer;
  font-size: 0.78rem;
}

.inline-btn:hover {
  border-color: rgba(31, 113, 221, 0.5);
}

.inline-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.inline-btn-danger {
  border-color: rgba(197, 53, 53, 0.28);
  color: #8a2f2f;
  margin-left: 6px;
}

.inline-btn-danger:hover {
  border-color: rgba(197, 53, 53, 0.55);
  background: rgba(232, 78, 78, 0.08);
}

.invite-code {
  display: inline-block;
  border-radius: 8px;
  padding: 2px 6px;
  background: rgba(26, 56, 96, 0.08);
  color: #1f3f6f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.76rem;
}

.user-op-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.user-op-wrap + .user-op-wrap {
  margin-top: 6px;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-active {
  color: #0d6c4b;
  background: rgba(47, 152, 112, 0.14);
  border: 1px solid rgba(47, 152, 112, 0.3);
}

.badge-banned,
.badge-revoked {
  color: #7f2f2f;
  background: rgba(208, 80, 80, 0.14);
  border: 1px solid rgba(208, 80, 80, 0.3);
}

.badge-inactive {
  color: #7a5a1c;
  background: rgba(197, 127, 34, 0.14);
  border: 1px solid rgba(197, 127, 34, 0.3);
}

@media (max-width: 980px) {
  .account-layout {
    grid-template-columns: 1fr;
  }

  .admin-area {
    grid-template-columns: 1fr;
  }

  .blog-admin-shell {
    grid-template-columns: 1fr;
  }

  .blog-form-grid.cols-2 {
    grid-template-columns: 1fr;
  }

  .session-auth-box {
    align-items: flex-start;
    flex-direction: column;
  }
}
