* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  background: linear-gradient(180deg, #eef4ff 0%, #f7f9fc 36%, #f5f7fb 100%);
  color: #1f2937;
}

body.auth-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 36%),
    radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.08), transparent 28%),
    #f5f7fb;
}

body.account-page {
  min-height: 100vh;
  background: #f3f4f6;
}

a {
  color: #2563eb;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}

button:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

button.danger-button {
  background: #ef4444;
  color: #fff;
}

button.danger-button:hover {
  background: #dc2626;
}

input,
select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.app-shell {
  padding: 20px 24px 28px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  max-width: none;
  margin: 0 auto;
  padding: 36px 28px;
}

.auth-hero {
  display: grid;
  gap: 20px;
  align-content: center;
  padding-right: 24px;
}

.auth-hero-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.auth-home-link {
  color: #1d4ed8;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.auth-home-link:hover {
  text-decoration: underline;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
}

.auth-hero-title {
  margin: 0;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
  color: #0f172a;
  letter-spacing: -0.04em;
}

.auth-hero-text {
  max-width: 520px;
  margin: 0;
  color: #64748b;
  font-size: 16px;
  line-height: 1.85;
}

.auth-card {
  width: min(50vw, 760px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(226, 232, 240, 0.96);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(18px);
}

.auth-card-header {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.auth-card-title {
  font-size: 28px;
  font-weight: 700;
  color: #0f172a;
}

.auth-card-subtitle {
  color: #64748b;
  line-height: 1.75;
}

.auth-form .message {
  margin-bottom: 0;
}

.auth-login-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 28px;
  align-items: start;
}

.auth-code-button {
  min-width: 116px;
}

.auth-submit-button {
  min-height: 52px;
  border-radius: 16px;
  font-weight: 700;
}

.auth-divider {
  position: relative;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

.auth-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: #e2e8f0;
}

.auth-divider span {
  position: relative;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.96);
}

.auth-wechat-button {
  min-height: 48px;
  border-radius: 16px;
}

.auth-extra-hint {
  font-size: 13px;
  color: #64748b;
  line-height: 1.7;
}

.auth-qr-login {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 16px 0 4px;
}

.auth-qr-title {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.auth-qr-box {
  width: 100%;
  min-height: 290px;
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #f8fafc;
  overflow: hidden;
}

.auth-qr-box iframe {
  max-width: 100%;
}

.auth-callback-shell {
  grid-template-columns: minmax(320px, 460px);
  justify-content: center;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 8px;
  padding: 2px 4px 2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-link {
  display: inline-flex;
  align-items: center;
  color: #1d4ed8;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

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

.auth-user-panel {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-user-name {
  color: #334155;
  font-size: 14px;
  font-weight: 600;
}

.bind-wechat-hint {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.account-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.account-card {
  width: min(96vw, 980px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e5e7eb;
  border-radius: 26px;
  padding: 26px 30px 10px;
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.1);
}

.account-card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 10px;
}

.account-card-title {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
}

.account-card-subtitle {
  margin-top: 8px;
  color: #6b7280;
  line-height: 1.7;
}

.account-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: #111827;
  font-size: 30px;
  line-height: 1;
  text-decoration: none;
}

.account-close-button:hover {
  background: #f3f4f6;
}

.account-section {
  display: grid;
}

.account-row {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 74px;
  padding: 0 4px;
  border-bottom: 1px solid #e5e7eb;
}

.account-action-section .account-row {
  min-height: 82px;
}

.account-label {
  color: #111827;
  font-size: 15px;
  font-weight: 600;
}

.account-value-block {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.account-value {
  color: #111827;
  font-size: 15px;
  word-break: break-word;
}

.account-inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.account-link-button {
  padding: 0;
  background: transparent;
  color: #2563eb;
  border-radius: 0;
}

.account-link-button:hover {
  background: transparent;
  color: #1d4ed8;
  text-decoration: underline;
}

.account-outline-danger-button {
  min-width: 92px;
  padding: 9px 22px;
  border: 1px solid #ef4444;
  border-radius: 999px;
  background: #fff;
  color: #ef4444;
}

.account-outline-danger-button:hover:enabled {
  background: #fff5f5;
}

.account-outline-danger-button:disabled {
  border-color: #fca5a5;
  background: #fff;
  color: #f87171;
  cursor: not-allowed;
}

.api-config-form {
  display: grid;
  gap: 8px;
  min-width: 280px;
}

.mobile-only {
  display: none;
}

.message {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #e0f2fe;
  color: #075985;
}

.message.error {
  background: #fee2e2;
  color: #991b1b;
}

.wechat-bind-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.wechat-bind-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.46);
}

.wechat-bind-dialog-card {
  position: relative;
  z-index: 1;
  width: min(92vw, 420px);
  padding: 20px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.2);
}

.wechat-bind-dialog-body {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.wechat-bind-qr-image {
  width: min(72vw, 280px);
  height: min(72vw, 280px);
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.wechat-bind-dialog-actions {
  display: flex;
  justify-content: center;
}

.bind-phone-dialog-body {
  justify-items: stretch;
}

.bind-phone-field,
.bind-phone-code-field {
  width: 100%;
}

.hidden {
  display: none !important;
}

.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  align-items: start;
}

.panel {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.panel-header h2,
.panel h3 {
  margin: 0;
}

.sidebar .panel-header h2 {
  font-size: 16px;
}

.task-list,
.stack-list {
  display: grid;
  gap: 12px;
}

.sidebar {
  position: sticky;
  top: 18px;
}

.sidebar .panel-header .inline-actions {
  align-items: center;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  z-index: 40;
}

.home-view,
.login-view,
.detail-view {
  display: grid;
  gap: 16px;
}

.login-view {
  min-height: calc(100vh - 120px);
  align-content: center;
  justify-items: center;
}

.login-card {
  width: min(520px, 100%);
  padding: 28px 24px;
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 10px;
}

.login-subtitle {
  color: #64748b;
  line-height: 1.7;
  margin-bottom: 20px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.code-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.code-input-wrap {
  display: grid;
  gap: 8px;
}

.home-view {
  min-height: inherit;
}

.hero {
  display: grid;
  justify-items: center;
  gap: 18px;
  min-height: 100%;
  align-content: center;
  padding: 16px 0;
}

.hero-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  max-width: 760px;
  text-align: center;
  color: #64748b;
  line-height: 1.8;
  font-size: 16px;
}

.detail-page {
  min-height: calc(100vh - 170px);
}

.detail-header-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ghost-button {
  align-self: flex-start;
  background: #eff6ff;
  color: #1d4ed8;
}

.ghost-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 10px;
  background: #eff6ff;
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 600;
}

.ghost-button:hover {
  background: #dbeafe;
}

.ghost-link-button:hover {
  background: #dbeafe;
}

.task-card,
.stack-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.task-thread {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  padding: 12px;
}

.task-thread:hover {
  background: rgba(37, 99, 235, 0.04);
}

.task-thread.selection-mode {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.task-thread.active {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.12);
}

.task-thread.selecting {
  background: rgba(37, 99, 235, 0.05);
}

.task-thread-checkbox {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 2px;
}

.task-thread-checkbox input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #2563eb;
}

.task-thread.pinned-task .task-thread-title::before {
  content: "置顶";
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

.icon-toggle-button {
  min-width: 36px;
  min-height: 36px;
  padding: 8px;
  border-radius: 10px;
}

.icon-toggle-button.is-active {
  background: #dbeafe;
}

.icon-toggle-lines {
  position: relative;
  display: inline-grid;
  gap: 4px;
}

.icon-toggle-lines span {
  display: block;
  width: 12px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.task-batch-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 10px;
  padding-top: 12px;
  margin-top: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95) 32%);
}

.task-batch-bar button {
  flex: 1;
  min-height: 40px;
}

.task-thread-body {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.task-thread-top,
.task-thread-bottom {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.task-thread-time {
  color: #94a3b8;
  font-size: 12px;
  white-space: nowrap;
}

.task-thread-title {
  margin-bottom: 0;
  font-size: 14px;
  line-height: 1.5;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  flex: 1;
}

.thread-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  font-size: 12px;
}

.thread-status.active {
  background: #dbeafe;
  color: #1d4ed8;
}

.thread-status.error {
  background: #fee2e2;
  color: #b91c1c;
}

.thread-status.paused {
  background: #fef3c7;
  color: #92400e;
}

.stack-card.compact {
  padding: 10px 12px;
}

.section-option-card {
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.section-option-card:hover,
.section-option-card:focus-visible {
  border-color: rgba(37, 99, 235, 0.28);
  background: #eff6ff;
  transform: translateY(-1px);
  outline: none;
}

.task-card.active {
  border-color: #2563eb;
  background: #eff6ff;
}

.task-card-title,
.stack-card-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.task-card-meta,
.muted {
  color: #64748b;
  font-size: 13px;
}

.content {
  display: grid;
  gap: 16px;
  min-height: calc(100vh - 80px);
}

.form-grid {
  display: grid;
  gap: 14px;
}

.chat-thread {
  display: grid;
  gap: 14px;
  width: min(100%, 920px);
  min-height: 220px;
  max-height: 520px;
  overflow: auto;
  padding: 6px 2px;
}

.chat-message {
  display: grid;
  gap: 6px;
}

.chat-message.user {
  justify-items: end;
}

.chat-role {
  font-size: 12px;
  color: #64748b;
}

.chat-bubble {
  width: min(100%, 760px);
  border-radius: 22px;
  padding: 16px 18px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid #e2e8f0;
  line-height: 1.75;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.chat-message.user .chat-bubble {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.chat-message.pending .chat-bubble {
  color: #64748b;
}

.chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 8px;
  align-items: center;
  width: min(50vw, 760px);
}

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

.chat-composer textarea {
  width: 100%;
  min-height: 112px;
  max-height: 220px;
  resize: vertical;
  border: 1px solid #dbe3f0;
  border-radius: 28px;
  padding: 22px 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 40px rgba(37, 99, 235, 0.08);
  font: inherit;
  color: inherit;
}

.analyze-source-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-left: 6px;
}

.analyze-source-button {
  min-width: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #334155;
  font-size: 14px;
  line-height: 1.4;
}

.analyze-source-button:hover {
  background: transparent;
  color: #1d4ed8;
}

.analyze-source-button.is-active {
  color: #1d4ed8;
  font-weight: 700;
}

.chat-composer button {
  height: 48px;
  padding: 0 20px;
  border-radius: 999px;
}

.wide-centered {
  justify-self: center;
}

.clamp-1,
.clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp-1 {
  -webkit-line-clamp: 1;
}

.clamp-2 {
  -webkit-line-clamp: 2;
}

.chat-summary {
  margin-bottom: 12px;
}

.chat-section-title {
  margin-bottom: 10px;
  font-weight: 700;
}

.result-note {
  margin-top: 12px;
  border-radius: 12px;
  padding: 12px 14px;
}

.result-note.success {
  background: #ecfdf5;
  color: #166534;
}

.result-note.warn {
  background: #fff7ed;
  color: #9a3412;
}

.field {
  display: grid;
  gap: 8px;
}

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

.task-name-row {
  align-items: start;
}

.task-name-editor {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.task-name-editor input {
  width: min(420px, 100%);
}

.small-button {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 999px;
}

.analysis-summary,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin-bottom: 14px;
}

.full-row {
  grid-column: 1 / -1;
}

.json-block {
  margin: 6px 0 0;
  padding: 12px;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.detail-sections {
  display: grid;
  gap: 16px;
}

.empty-state {
  padding: 24px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  color: #64748b;
  text-align: center;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 10px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
}

.empty-inline {
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
}

.admin-layout {
  display: grid;
  gap: 16px;
  padding: 0 16px 20px;
}

.admin-overview-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-stat-card {
  border-radius: 14px;
  background: #f8fafc;
  padding: 16px;
}

.admin-stat-label {
  color: #64748b;
  font-size: 13px;
}

.admin-stat-value {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 700;
  color: #0f172a;
}

.admin-panel-header {
  align-items: start;
  gap: 12px;
}

.admin-search-input {
  min-width: 220px;
  border: 1px solid #d7deea;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
}

.admin-user-list,
.admin-task-list {
  display: grid;
  gap: 12px;
}

.admin-user-item {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.admin-user-item.is-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}

.admin-user-main,
.admin-user-side {
  display: grid;
  gap: 6px;
}

.admin-user-side {
  justify-items: end;
}

.admin-user-name-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-user-name {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

.admin-user-meta,
.admin-user-task-count,
.admin-selected-user-summary,
.admin-task-url,
.admin-task-time {
  color: #64748b;
  font-size: 13px;
}

.admin-task-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
  display: grid;
  gap: 10px;
}

.admin-task-tools {
  display: grid;
  gap: 12px;
}

.admin-task-edit-field label {
  font-size: 13px;
  color: #475569;
}

.admin-inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.admin-task-name-input,
.admin-task-owner-select {
  min-width: 220px;
  border: 1px solid #d7deea;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
}

.admin-task-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.admin-task-title {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

.admin-task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-task-notifications {
  display: grid;
  gap: 10px;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
}

.admin-notify-item {
  display: grid;
  gap: 8px;
  border-radius: 12px;
  background: #f8fafc;
  padding: 12px;
}

.admin-notify-head {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-notify-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

.admin-notify-body {
  font-size: 13px;
  line-height: 1.6;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 980px) {
  body {
    background: #f6f8fb;
  }

  body.auth-page {
    background: #f6f8fb;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 20px 16px 32px;
  }

  .auth-card {
    width: min(100%, 760px);
  }

  .auth-login-split {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .auth-qr-login {
    padding-top: 0;
  }

  .admin-overview-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-user-item,
  .admin-task-header {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-user-side {
    justify-items: start;
  }

  .account-card {
    width: min(100%, 920px);
  }

  .account-row {
    grid-template-columns: 140px minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .admin-overview-cards {
    grid-template-columns: 1fr;
  }


  .auth-hero-title {
    font-size: 30px;
    line-height: 1.15;
  }

  .auth-hero-text {
    font-size: 14px;
    line-height: 1.75;
  }

  .auth-card {
    padding: 20px 16px;
    border-radius: 24px;
  }

  .auth-card-title {
    font-size: 24px;
  }

  .mobile-only {
    display: inline-flex;
  }

  .app-shell {
    padding: 12px 12px calc(110px + env(safe-area-inset-bottom, 0px));
  }

  .layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    flex-direction: row;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 4px 6px;
    background: rgba(246, 248, 251, 0.92);
    backdrop-filter: blur(14px);
  }

  .api-config-form {
    width: 100%;
    min-width: 0;
  }

  .analysis-summary,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    gap: 8px;
  }

  .auth-user-panel {
    flex-wrap: wrap;
    gap: 8px;
  }

  .login-view {
    min-height: auto;
    align-content: start;
  }

  .login-card {
    padding: 20px 16px;
  }

  .login-title {
    font-size: 20px;
    line-height: 1.35;
  }

  .code-field {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(84vw, 360px);
    border-radius: 0 24px 24px 0;
    transform: translateX(-104%);
    transition: transform 0.24s ease;
    z-index: 50;
    overflow: auto;
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
  }

  .content {
    gap: 12px;
    min-height: auto;
  }

  .chat-composer {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 30;
    width: auto;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  }

  .hero {
    min-height: auto;
    padding: 10px 0 120px;
    gap: 14px;
    align-content: start;
  }

  .hero-title {
    font-size: 20px;
    line-height: 1.3;
  }

  .hero-subtitle {
    font-size: 14px;
    line-height: 1.7;
  }

  .chat-thread {
    width: 100%;
    min-height: 160px;
    max-height: none;
    padding-bottom: 8px;
  }

  .chat-bubble {
    width: 100%;
  }

  .chat-composer textarea {
    min-height: 72px;
    max-height: 160px;
    padding: 14px 16px;
    border-radius: 20px;
  }

  .chat-composer button {
    align-self: end;
    height: 44px;
  }

  .detail-page {
    min-height: calc(100vh - 100px);
  }

  .panel {
    border-radius: 18px;
    padding: 14px;
  }

  .panel-header {
    align-items: flex-start;
  }

  .detail-sections {
    gap: 12px;
  }

  .task-thread {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  .account-shell {
    padding: 12px;
    align-items: start;
  }

  .account-card {
    width: 100%;
    padding: 18px 16px 8px;
    border-radius: 20px;
  }

  .account-card-title {
    font-size: 24px;
  }

  .account-row {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: start;
    padding: 14px 2px;
    min-height: 0;
  }

  .account-value-block {
    flex-direction: column;
    align-items: flex-start;
  }

  .account-inline-actions {
    justify-content: flex-start;
  }
}
