:root {
  --bg: #f3faef;
  --card: #ffffff;
  --line: #dce9d6;
  --text: #1f2d22;
  --subtle: #5f6f61;
  --primary: #4a9f39;
  --primary-soft: #8fd17a;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow: 0 8px 28px rgba(62, 110, 50, 0.08);
  --scrollbar-size: 10px;
  --scrollbar-track: #e8f2e2;
  --scrollbar-thumb: #92be86;
  --scrollbar-thumb-hover: #72ab62;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family:
    "Noto Sans SC",
    "PingFang SC",
    "Microsoft YaHei",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 6% -8%, #d9efce 0%, rgba(217, 239, 206, 0) 52%),
    radial-gradient(circle at 94% -6%, #e3f8d8 0%, rgba(227, 248, 216, 0) 46%),
    var(--bg);
  min-height: 100vh;
  overflow-x: clip;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

*::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

*::-webkit-scrollbar-button {
  width: 0;
  height: 0;
  display: none;
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

.app-shell {
  width: min(1640px, 100vw - 26px);
  margin: 0 auto 22px;
  min-height: calc(100vh - 34px);
  display: flex;
  flex-direction: column;
}

.panel,
.card,
.dialog-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
}

.topbar {
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: block;
  object-fit: cover;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(74, 159, 57, 0.25);
}

.brand h1 {
  margin: 0;
  font-size: 22px;
}

.brand p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--subtle);
}

.top-actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.top-btn {
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  text-decoration: none;
}

.landing-topbar {
  margin-bottom: 18px;
}

.landing-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.landing-main {
  width: min(1120px, 100vw - 28px);
  margin: 0 auto 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.landing-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 16px;
}

.landing-card h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.landing-card p {
  margin: 0 0 10px;
  line-height: 1.8;
}

.landing-card p:last-child {
  margin-bottom: 0;
}

.landing-card ol,
.landing-card ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.8;
}

.layout {
  display: grid;
  grid-template-columns: 280px minmax(500px, 1.15fr) minmax(460px, 1fr);
  gap: 12px;
  align-items: stretch;
  flex: 1;
  min-height: 0;
}

.layout.project-collapsed {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.project-expand-dock {
  position: fixed;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 52px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 12px 12px 0;
  background: #f6fbf2;
  color: #35552f;
  font-size: 18px;
  cursor: pointer;
  z-index: 35;
  box-shadow: 0 8px 18px rgba(62, 110, 50, 0.14);
}

.panel {
  padding: 12px;
}

.middle-panel,
.editor-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.middle-panel {
  min-height: 760px;
}

.editor-panel {
  min-height: 760px;
}

.panel-head,
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.panel-head {
  margin-bottom: 10px;
}

.panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-head h2,
.workspace-head h2 {
  margin: 0;
  font-size: 19px;
}

.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.workspace-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.workspace-head .subtle {
  margin-top: 5px;
}

.project-panel.fully-hidden {
  display: none;
}

.project-panel {
  position: relative;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: visible;
}

.project-panel-foot {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  background: var(--card);
}

.project-transfer-btn,
.project-import-btn {
  flex: 1 1 50%;
  width: calc(50% - 4px);
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.btn-icon-svg {
  width: 1em;
  height: 1em;
  display: block;
}

.btn-text {
  white-space: nowrap;
}

#toggleMetaBtn,
#exportCurrentBtn,
#expandBtn,
#optimizeBtn,
#saveBodyBtn,
[data-action="add-outline"],
[data-action="generate-body"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  border-radius: 999px;
}

/* Keep outline action buttons pill-shaped even with .btn base styles */
.btn[data-action="add-outline"],
.btn[data-action="generate-body"] {
  border-radius: 999px;
}

.project-item {
  position: relative;
  z-index: 1;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fbfdf9;
  padding: 10px;
  cursor: pointer;
  transition: 0.15s ease;
}

.project-item.menu-open {
  z-index: 120;
}

.project-item:hover {
  transform: translateY(-1px);
  border-color: #b8d9ac;
}

.project-item.active {
  border-color: var(--primary-soft);
  box-shadow: inset 0 0 0 1px var(--primary-soft);
  background: #f1faec;
}

.project-title-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.project-title-actions {
  position: relative;
  z-index: 2;
}

.project-item.menu-open .project-title-actions {
  z-index: 121;
}

.project-menu-btn {
  width: 28px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #456b3d;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.project-menu {
  position: absolute;
  right: 0;
  top: 30px;
  min-width: 96px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 20px rgba(40, 65, 44, 0.16);
  padding: 6px;
  display: none;
  z-index: 122;
}

.project-menu.open {
  display: block;
}

.project-menu-item {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
  color: #304c2b;
  cursor: pointer;
}

.project-menu-item:hover {
  background: #eef8e8;
}

.project-menu-item.danger {
  color: #b93e3e;
}

.project-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.project-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--subtle);
}

.card {
  padding: 12px;
}

.card-head h3 {
  margin: 0;
  font-size: 16px;
}

.tab-card-head {
  align-items: center;
}

.tab-head-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tab-nav-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fdf4;
  color: #35552f;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.tab-nav-btn:hover:not(:disabled) {
  background: #edf8e6;
}

.tab-nav-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.card-head-wrap {
  align-items: center;
}

.tool-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 8px;
}

.meta-item {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 8px;
  background: #fcfffa;
}

.meta-key {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--subtle);
}

.meta-value {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  word-break: break-word;
}

.tab-card {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.tab-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 8px 0;
  margin: 8px 0;
}

.tab-btn {
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fdf4;
  color: #35552f;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 12px;
  cursor: pointer;
}

.tab-btn.active {
  border-color: var(--primary-soft);
  background: #eaf7e4;
}

.tab-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfffa;
  padding: 10px;
  flex: 1;
  min-height: 0;
  max-height: calc(100vh - 290px);
  overflow: auto;
}

.tab-panel.outline-mode {
  border: 0;
  background: transparent;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: calc(100vh - 290px);
  max-height: calc(100vh - 290px);
}

.outline-inline-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfffa;
  padding: 10px;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.outline-inline-card .card-head {
  margin-bottom: 10px;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-item {
  border: 1px solid #e4eee0;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
}

.info-item.editable {
  cursor: pointer;
  transition: 0.15s ease;
}

.info-item.editable:hover {
  border-color: #b8d9ac;
  background: #f6fbf2;
  transform: translateY(-1px);
}

.inline-editable {
  cursor: text;
}

.inline-editable.editing {
  border-radius: 8px;
  outline: 2px solid #9dcf90;
  outline-offset: 2px;
  background: #ffffff;
}

.info-item p {
  margin: 0;
  line-height: 1.6;
  font-size: 13px;
}

.info-item-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
}

.outline-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 10px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.outline-list {
  border: 1px solid var(--line);
  border-radius: 12px;
  max-height: none;
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 6px;
  background: #fbfdf9;
}

.outline-item {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
}

.outline-item:hover {
  border-color: #c8dfbf;
  background: #f6fbf2;
}

.outline-item.active {
  border-color: var(--primary-soft);
  background: #eef8e8;
}

.outline-item-title {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

.outline-title-text {
  min-width: 0;
}

.outline-gen-status {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
}

.outline-gen-status.generated {
  color: var(--primary);
}

.outline-gen-status.pending {
  color: #8d9691;
}

.outline-item-text {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--subtle);
}

.role-field-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.role-field-line {
  margin: 0;
  line-height: 1.7;
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.role-field-label {
  color: var(--subtle);
  font-weight: 700;
  white-space: nowrap;
}

.role-field-value {
  min-width: 0;
  word-break: break-word;
}

.outline-detail-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfffa;
  padding: 10px;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.outline-detail-box h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.outline-detail {
  min-height: 0;
  height: 100%;
  overflow: auto;
}

.outline-detail p {
  margin: 0 0 8px;
  line-height: 1.7;
  font-size: 14px;
}

.editor-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.editor-card .card-head {
  margin-bottom: 12px;
}

.editor-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
}

.editor-loading {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(252, 255, 250, 0.94);
  color: #35552f;
  font-size: 14px;
  font-weight: 600;
}

.editor-loading-spinner {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 3px solid #d2e8ca;
  border-top-color: #5cae4a;
  animation: editor-loading-spin 0.9s linear infinite;
}

.editor-thinking-box {
  width: min(760px, 100%);
  border: 1px solid #d8e8d2;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px;
}

.editor-thinking-title {
  margin: 0 0 8px;
  font-size: 12px;
  color: #4f6f49;
  font-weight: 700;
}

.editor-thinking-log {
  margin: 0;
  min-height: calc(1.6em * 5);
  max-height: calc(1.6em * 5);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
  font-size: 12px;
  color: #2f4b2b;
  font-family: "Consolas", "Menlo", "Monaco", monospace;
}

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

.body-editor {
  width: 100%;
  height: 100%;
  min-height: 610px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  line-height: 1.8;
  background: #fcfffa;
}

.body-editor::selection {
  background: var(--primary);
  color: #ffffff;
}

.body-editor::-moz-selection {
  background: var(--primary);
  color: #ffffff;
}

.editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.floating-ai-btn {
  position: fixed;
  z-index: 30;
  border: 1px solid #5aa949;
  background: linear-gradient(180deg, #7cc86a, #56a745);
  color: #fff;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(62, 122, 47, 0.28);
  cursor: pointer;
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s ease;
}

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

.btn-small {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-primary {
  background: linear-gradient(180deg, #6fbe5f, var(--primary));
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(0.95);
}

.btn-secondary {
  background: #f6fbf2;
  border-color: var(--line);
  color: #35552f;
}

.btn-secondary:hover:not(:disabled) {
  background: #edf8e6;
}

.subtle {
  color: var(--subtle);
  font-size: 12px;
}

.auth-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdf9;
}

.auth-box.auth-box-guest {
  width: auto;
  flex-wrap: nowrap;
  gap: 0;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
}

.balance-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid #c8e2be;
  background: #e9f6e2;
  color: #346a2a;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  border-radius: 99px;
  background: #e9f6e2;
  color: #396e2f;
  font-size: 12px;
  font-weight: 700;
  padding: 0 8px;
}

.mini-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  color: #456b3d;
  cursor: pointer;
}

.file-btn {
  position: relative;
  overflow: hidden;
}

.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dialog {
  position: fixed;
  inset: 0;
  background: rgba(15, 22, 16, 0.5);
  display: grid;
  place-items: center;
  z-index: 40;
  padding: 12px;
}

.dialog-panel {
  width: min(700px, 100%);
  padding: 14px;
}

.dialog-small {
  width: min(540px, 100%);
}

.dialog-large {
  width: min(920px, 100%);
}

.dialog-panel h3 {
  margin: 0 0 6px;
}

.dialog-preview,
.dialog-input,
.dialog-text-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  font-size: 14px;
  background: #fbfdf9;
}

.dialog-preview {
  min-height: 120px;
  margin: 8px 0;
}

.dialog-input {
  min-height: 84px;
}

.dialog-text-input {
  height: 42px;
  margin-bottom: 10px;
}

.field-label {
  display: block;
  margin: 8px 0 6px;
  font-size: 12px;
  color: var(--subtle);
}

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

.dialog-error {
  margin: -2px 0 0;
  font-size: 12px;
  color: #b93e3e;
}

.airdrop-dialog-panel {
  width: min(980px, 100%);
}

.airdrop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.airdrop-receive-card {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdf9;
  padding: 12px;
  display: flex;
  align-items: stretch;
  gap: 14px;
}

.airdrop-qr-wrap {
  width: 220px;
  flex: 0 0 220px;
  border: 1px dashed #c9ddc1;
  border-radius: 12px;
  background: #ffffff;
  display: grid;
  place-items: center;
  padding: 10px;
}

.airdrop-qr-image {
  width: min(190px, 100%);
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: contain;
}

.airdrop-session-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.airdrop-session-label {
  margin: 0;
  font-size: 12px;
  color: var(--subtle);
}

.airdrop-session-code {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #2f5f28;
  line-height: 1.1;
}

.airdrop-qr-link {
  display: inline-block;
  max-width: 100%;
  word-break: break-all;
  text-decoration: none;
}

.airdrop-progress {
  margin: 12px 0 0;
  min-height: 18px;
}

.airdrop-pair-tip {
  margin: 0;
}

.airdrop-tabbar {
  margin-top: 12px;
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  border-radius: 999px;
  background: #eef4ec;
}

.airdrop-tab-btn {
  border: 0;
  background: transparent;
  color: var(--subtle);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.airdrop-tab-btn.active {
  color: #214f28;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.airdrop-tab-section {
  margin-top: 12px;
}

.airdrop-send-row {
  margin-bottom: 8px;
}

.airdrop-send-select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  background: #fff;
  color: var(--text);
}

.airdrop-send-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 8px;
}

.airdrop-send-hint {
  margin: 10px 0 0;
  min-height: 18px;
}

.airdrop-file-list {
  margin-top: 10px;
  max-height: min(32vh, 260px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.airdrop-file-empty {
  padding: 14px 12px;
  color: var(--subtle);
}

.airdrop-file-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.airdrop-file-item:last-child {
  border-bottom: 0;
}

.airdrop-file-name {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.airdrop-file-meta {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--subtle);
}

.airdrop-status[data-state="ready"] {
  background: #e8f4ff;
  color: #215f8e;
}

.airdrop-status[data-state="connected"] {
  background: #e9f6e2;
  color: #2f6a25;
}

.airdrop-status[data-state="error"] {
  background: #ffefef;
  color: #a23939;
}

.ai-flavor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.ai-flavor-list {
  max-height: min(62vh, 640px);
  overflow: auto;
  padding: 2px;
}

.ai-flavor-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
}

.ai-flavor-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  margin-bottom: 10px;
}

.ai-flavor-item h4 {
  margin: 0;
  font-size: 13px;
}

.ai-flavor-diff {
  margin-top: 8px;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.6;
  word-break: break-word;
}

.ai-flavor-diff.minus {
  background: #ffefef;
  color: #b93e3e;
}

.ai-flavor-diff.plus {
  background: #edf9e9;
  color: #2c7a22;
}

.ai-flavor-reason {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--subtle);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #172418;
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  padding: 8px 14px;
  z-index: 60;
  box-shadow: 0 6px 26px rgba(0, 0, 0, 0.25);
}

.hidden,
.dialog.hidden,
.toast.hidden {
  display: none !important;
}

/* Clerk auth popup: remove non-essential blocks in sign-in/sign-up */
.cl-headerSubtitle,
.cl-socialButtons,
.cl-socialButtonsBlockButton,
.cl-alternativeMethods,
.cl-identityPreview,
.cl-dividerRow,
.cl-formFieldRow__name {
  display: none !important;
}

.cl-headerTitle {
  display: block !important;
  font-size: 18px !important;
  font-weight: 700 !important;
}

.cl-rootBox [data-localization-key="dividerText"] {
  display: none !important;
}

.cl-rootBox [data-localization-key="formFieldLabel__firstName"],
.cl-rootBox [data-localization-key="formFieldLabel__lastName"] {
  display: none !important;
}

.cl-rootBox #firstName-field,
.cl-rootBox #lastName-field {
  display: none !important;
}

@media (max-width: 1480px) {
  .layout {
    grid-template-columns: 250px minmax(420px, 1fr) minmax(360px, 0.95fr);
  }
}

@media (max-width: 1200px) {
  .landing-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .layout.project-collapsed {
    grid-template-columns: 1fr;
  }

  .project-list {
    max-height: 260px;
  }

  .outline-layout {
    grid-template-columns: 1fr;
  }

  .middle-panel {
    min-height: 0;
  }

  .tab-card {
    min-height: 260px;
  }

  .tab-panel {
    min-height: 170px;
    max-height: none;
  }

  .tab-panel.outline-mode {
    height: auto;
    max-height: none;
  }

  .body-editor {
    min-height: 380px;
  }

  .project-expand-dock {
    left: 6px;
    width: 34px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: calc(100vw - 16px);
    margin: 0 auto 14px;
    min-height: calc(100vh - 22px);
  }

  .topbar {
    padding: 12px 12px 14px;
    flex-direction: column;
    align-items: flex-start;
  }

  .top-actions {
    width: 100%;
    flex-direction: column;
  }

  .top-btn {
    width: 100%;
  }

  .auth-box {
    width: 100%;
    flex-wrap: wrap;
    padding: 8px;
  }

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

  .workspace-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .landing-main {
    width: calc(100vw - 16px);
    margin: 0 auto 16px;
    grid-template-columns: 1fr;
  }

  .landing-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .airdrop-receive-card {
    flex-direction: column;
  }

  .airdrop-qr-wrap {
    width: 100%;
    flex: none;
  }
}

.marketing-page {
  background:
    radial-gradient(circle at 5% -12%, #c7efd8 0%, rgba(199, 239, 216, 0) 48%),
    radial-gradient(circle at 95% -10%, #d6f2e6 0%, rgba(214, 242, 230, 0) 46%),
    #f4faf6;
  color: #1f2d22;
}

.marketing-container {
  width: min(1160px, calc(100vw - 32px));
  margin: 0 auto;
}

.marketing-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(244, 250, 246, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #d8e8db;
}

.marketing-header-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.marketing-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.marketing-logo img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
}

.marketing-logo span {
  font-size: 20px;
  font-weight: 800;
}

.marketing-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.marketing-nav a {
  color: #38553e;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.marketing-nav a:hover {
  color: #2f8a4b;
}

.marketing-hero {
  padding: 52px 0 34px;
}

.marketing-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 18px;
  align-items: stretch;
}

.marketing-hero-content {
  border: 1px solid #d8e8db;
  border-radius: 24px;
  padding: 30px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(240, 250, 244, 0.96));
  box-shadow: 0 18px 44px rgba(62, 110, 50, 0.12);
}

.marketing-tag {
  margin: 0;
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e7f8ec;
  color: #2b8b48;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.marketing-hero-content h1 {
  margin: 14px 0 12px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.2;
}

.marketing-hero-content > p {
  margin: 0;
  color: #486250;
  font-size: 16px;
  line-height: 1.8;
}

.marketing-cta-group {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.marketing-btn {
  min-width: 128px;
  height: 46px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.marketing-btn:hover {
  transform: translateY(-1px);
}

.marketing-btn-outline {
  border: 1px solid #b8d7c2;
  background: #ffffff;
  color: #325842;
}

.marketing-btn-outline:hover {
  filter: brightness(0.97);
}

.marketing-btn-primary {
  border: 1px solid #3f9a57;
  color: #ffffff;
  background: linear-gradient(160deg, #4eba69, #2f8a4b);
}

.marketing-btn-primary:hover {
  filter: brightness(0.95);
}

.marketing-hero-card {
  border: 1px solid #d8e8db;
  border-radius: 24px;
  padding: 24px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(62, 110, 50, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.marketing-hero-card img {
  width: min(180px, 65%);
  max-width: 180px;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 20px 40px rgba(32, 91, 50, 0.2);
}

.marketing-hero-card h2 {
  margin: 18px 0 8px;
  font-size: 24px;
}

.marketing-hero-card p {
  margin: 0;
  color: #557060;
  line-height: 1.7;
}

.marketing-section {
  padding: 20px 0;
}

.marketing-section-title {
  margin: 0 0 14px;
  font-size: clamp(24px, 2.7vw, 32px);
}

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

.marketing-store-card {
  border: 1px solid #d8e8db;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(62, 110, 50, 0.09);
  padding: 10px;
}

.marketing-store-placeholder {
  width: 100%;
  aspect-ratio: 9 / 19.5;
  border: 1px dashed #c8ddce;
  border-radius: 12px;
  background:
    linear-gradient(
      135deg,
      rgba(233, 246, 238, 0.9) 0%,
      rgba(249, 253, 251, 0.95) 50%,
      rgba(237, 248, 243, 0.9) 100%
    );
}

.marketing-doc-card {
  border: 1px solid #d8e8db;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(62, 110, 50, 0.09);
  overflow: hidden;
}

.marketing-doc-head {
  padding: 20px 22px;
  border-bottom: 1px solid #e2efe5;
  background: linear-gradient(150deg, #f4fbf6, #ffffff);
}

.marketing-doc-head h3 {
  margin: 0;
  font-size: clamp(20px, 2.3vw, 28px);
}

.marketing-doc-meta {
  margin: 8px 0 0;
  color: #4f6958;
  font-size: 14px;
}

.marketing-doc-content {
  padding: 20px 22px 22px;
}

.marketing-doc-content h4 {
  margin: 22px 0 10px;
  font-size: 20px;
}

.marketing-doc-content h5 {
  margin: 14px 0 8px;
  font-size: 17px;
}

.marketing-doc-content p {
  margin: 0 0 10px;
  color: #3f5a49;
  line-height: 1.9;
  font-size: 15px;
}

.marketing-doc-content ul,
.marketing-doc-content ol {
  margin: 0 0 10px;
  padding-left: 20px;
  color: #3f5a49;
  line-height: 1.9;
  font-size: 15px;
}

.marketing-doc-content li {
  margin: 0 0 4px;
}

.marketing-feature-grid,
.marketing-step-grid,
.marketing-privacy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.marketing-feature-card,
.marketing-step-card,
.marketing-privacy-card,
.marketing-notice-card,
.marketing-shot-card {
  border: 1px solid #d8e8db;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(62, 110, 50, 0.09);
}

.marketing-feature-card,
.marketing-step-card,
.marketing-privacy-card {
  padding: 18px;
}

.marketing-feature-card h3,
.marketing-step-card h3,
.marketing-privacy-card h3,
.marketing-shot-card h3,
.marketing-notice-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.marketing-feature-card p,
.marketing-step-card p,
.marketing-privacy-card p,
.marketing-shot-card p {
  margin: 0;
  color: #516b5a;
  line-height: 1.8;
}

.marketing-shot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.marketing-shot-card {
  overflow: hidden;
}

.marketing-shot-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  padding: 20px;
  background: linear-gradient(150deg, #edf8f1, #f9fdfa);
}

.marketing-shot-card h3,
.marketing-shot-card p {
  padding: 0 16px;
}

.marketing-shot-card h3 {
  margin-top: 12px;
}

.marketing-shot-card p {
  margin-bottom: 16px;
}

.marketing-step-card {
  position: relative;
  padding-top: 46px;
}

.marketing-step-number {
  position: absolute;
  left: 16px;
  top: 14px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #e7f8ec;
  color: #2b8b48;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}

.marketing-notice-card {
  padding: 20px;
}

.marketing-notice-card h3 {
  margin-bottom: 10px;
}

.marketing-notice-card ul {
  margin: 0;
  padding-left: 20px;
  color: #4f6958;
  line-height: 1.9;
}

.marketing-footer {
  margin-top: 22px;
  padding: 18px 0;
  border-top: 1px solid #d8e8db;
  background: #eff7f1;
}

.marketing-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.marketing-footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.marketing-footer-brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
}

.marketing-footer-brand h3 {
  margin: 0;
  font-size: 19px;
}

.marketing-footer-brand p {
  margin: 4px 0 0;
  color: #567061;
  font-size: 13px;
}

.marketing-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.marketing-footer-links a {
  color: #38553e;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.marketing-footer-links a:hover {
  color: #2f8a4b;
}

@media (max-width: 980px) {
  .marketing-header-inner {
    min-height: auto;
    padding: 12px 0;
    flex-direction: column;
    align-items: flex-start;
  }

  .marketing-nav {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
  }

  .marketing-hero {
    padding-top: 28px;
  }

  .marketing-hero-grid,
  .marketing-shot-grid {
    grid-template-columns: 1fr;
  }

  .marketing-store-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .marketing-feature-grid,
  .marketing-step-grid,
  .marketing-privacy-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .marketing-container {
    width: calc(100vw - 18px);
  }

  .marketing-hero-content {
    padding: 20px 16px;
    border-radius: 18px;
  }

  .marketing-hero-card {
    border-radius: 18px;
    padding: 20px 14px;
  }

  .marketing-btn {
    width: 100%;
  }

  .marketing-store-card {
    padding: 8px;
  }

  .marketing-store-grid {
    grid-template-columns: 1fr;
  }

  .marketing-section {
    padding: 16px 0;
  }

  .marketing-doc-head,
  .marketing-doc-content {
    padding-left: 14px;
    padding-right: 14px;
  }

  .marketing-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

.balance-page {
  min-height: 100vh;
}

.balance-main {
  width: min(1180px, calc(100vw - 26px));
  margin: 0 auto 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.balance-card {
  padding: 12px;
}

.balance-card h2 {
  margin: 0;
  font-size: 18px;
}

.balance-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.balance-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed #d7e6d1;
}

.balance-summary-row:last-of-type {
  border-bottom: 0;
}

.balance-summary-row strong {
  font-size: 16px;
}

.balance-actions-row {
  margin-top: 10px;
}

.balance-stats-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.balance-stat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #e0ecdb;
  border-radius: 12px;
  background: #fbfdf9;
  padding: 9px 10px;
  font-size: 13px;
}

.balance-stat-item strong {
  font-size: 13px;
}

.balance-loading,
.balance-empty {
  margin: 6px 2px 4px;
  color: var(--subtle);
  font-size: 13px;
}

.balance-log-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.balance-log-card {
  border: 1px solid #dce9d6;
  border-radius: 12px;
  background: #ffffff;
}

.balance-log-summary {
  cursor: pointer;
  padding: 10px 12px;
  list-style: none;
}

.balance-log-summary::-webkit-details-marker {
  display: none;
}

.balance-log-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.balance-scene-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 3px 10px;
  border: 1px solid #cde4c5;
  background: #eef8e9;
  color: #355f30;
  font-size: 12px;
  font-weight: 700;
}

.balance-log-meta {
  margin-top: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--subtle);
  font-size: 12px;
}

.balance-log-detail {
  border-top: 1px dashed #dce9d6;
  padding: 10px 12px;
}

.balance-log-detail p {
  margin: 0 0 8px;
  line-height: 1.6;
  font-size: 13px;
  display: flex;
  gap: 8px;
}

.balance-log-detail p:last-child {
  margin-bottom: 0;
}

.balance-log-detail span {
  width: 72px;
  color: var(--subtle);
  flex: 0 0 72px;
}

.balance-log-detail code {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Consolas", "Menlo", "Monaco", monospace;
  background: #f7fbf4;
  border: 1px solid #e0ecdb;
  border-radius: 8px;
  padding: 2px 6px;
  color: #29412e;
}

.balance-dialog-info {
  margin: 8px 0 0;
  font-size: 13px;
}

.balance-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.balance-chip-btn {
  border: 1px solid #cbe3c2;
  border-radius: 999px;
  background: #f7fcf4;
  color: #355f30;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
}

.balance-chip-btn.active {
  border-color: #63b151;
  background: #e9f8e3;
}

@media (max-width: 940px) {
  .balance-overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .balance-main {
    width: calc(100vw - 16px);
    margin: 0 auto 16px;
  }

  .balance-log-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .balance-log-detail p {
    flex-direction: column;
    gap: 4px;
  }

  .balance-log-detail span {
    width: auto;
    flex: none;
  }
}
