.appbody { height: 100svh; display: flex; flex-direction: column; overflow: hidden; }
.appbody .nav { position: static; flex: none; }
#root { flex: 1; min-height: 0; width: 100%; padding-top: 24px; padding-bottom: 24px; }
.shell { height: 100%; display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; }
.pane { background: var(--surface); border-radius: var(--r-card); box-shadow: 0 0 0 1px var(--line); min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

/* wallet pill */
.wpill { height: 44px; padding: 0 8px 0 16px; display: inline-flex; align-items: center; gap: 10px; border-radius: var(--r-pill); background: var(--surface); box-shadow: 0 0 0 1px var(--line); font-size: 15px; }
.wpill .k { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.wpill button { height: 30px; padding: 0 12px; border-radius: var(--r-pill); font-size: 13px; color: var(--ink-60); transition: background-color .16s var(--ease), color .16s var(--ease); }
.wpill button:hover { background: var(--surface-2); color: var(--ink); }

/* list */
.list-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 12px 24px; }
.list-head h1 { margin: 0; font-weight: 400; font-size: 28px; letter-spacing: -0.03em; }
.keychip { margin: 0 20px 12px 24px; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--paper); font-size: 13px; color: var(--ink-60); }
.keychip b { color: var(--ink); font-weight: 500; }
.keychip svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.convs { flex: 1; overflow-y: auto; padding: 4px 12px 12px; }
.conv { width: 100%; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border-radius: 16px; text-align: left; transition: background-color .14s var(--ease); }
.conv:hover { background: var(--paper); }
.conv[aria-current="true"] { background: var(--accent-soft); }
.av { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font: 400 13px var(--mono); color: var(--ink-60); text-transform: uppercase; }
.conv[aria-current="true"] .av { background: #fff; color: var(--accent); }
.conv .t { display: block; font-size: 15px; font-weight: 500; }
.conv .p { display: block; font-size: 14px; color: var(--ink-60); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.conv .r { text-align: right; font-size: 12px; color: var(--ink-40); }
.conv .r .sol { display: block; margin-top: 4px; color: var(--accent); font-variant-numeric: tabular-nums; }
.list-empty { padding: 32px 24px; color: var(--ink-60); font-size: 14px; line-height: 1.5; }

/* thread */
.th-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px 16px 24px; border-bottom: 1px solid var(--line); min-height: 76px; }
.th-head .who { min-width: 0; }
.th-head .who b { display: block; font-weight: 500; font-size: 16px; }
.th-head .who span { display: block; font-size: 13px; color: var(--ink-60); margin-top: 1px; }
.th-head .acts { margin-left: auto; display: flex; gap: 6px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-60); transition: background-color .16s var(--ease), color .16s var(--ease); }
.icon-btn:hover { background: var(--paper); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.msgs { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 4px; }
.day { align-self: center; font: 400 12px var(--mono); color: var(--ink-40); margin: 12px 0; }
.m { max-width: min(560px, 76%); }
.m.out { align-self: flex-end; }
.m .bub { padding: 12px 16px; border-radius: 20px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.m.in .bub { background: var(--paper); border-bottom-left-radius: 6px; }
.m.out .bub { background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.m.pending .bub { opacity: .6; }
.m.err .bub { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink-60); font-style: italic; }
.m .pay { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; font-size: 28px; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.m .pay small { font-size: 14px; opacity: .7; letter-spacing: 0; }
.m .info { margin: 6px 6px 10px; font: 400 11px var(--mono); color: var(--ink-40); }
.m.out .info { text-align: right; }
.m .info a { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 2px; }
.m .info a:hover { color: var(--ink); }
.m .ok { color: var(--accent); }

.composer { border-top: 1px solid var(--line); padding: 16px 20px 18px; }
.composer-row { display: grid; grid-template-columns: minmax(0, 1fr) 132px auto; gap: 10px; align-items: end; }
.composer textarea { min-height: 52px; max-height: 160px; height: 52px; padding: 14px 16px; }
.composer .hint { margin-top: 10px; display: flex; justify-content: space-between; font: 400 12px var(--mono); color: var(--ink-40); }
.composer .hint .over { color: #C4321E; }

/* center states */
.center { flex: 1; display: grid; place-items: center; padding: 32px; text-align: center; }
.center .box { max-width: 440px; }
.center h2 { margin: 0; font-weight: 400; font-size: 40px; line-height: 44px; letter-spacing: -0.03em; }
.center p { margin: 14px auto 0; color: var(--ink-60); font-size: 16px; line-height: 1.5; max-width: 38ch; }
.center .btn { margin-top: 28px; }
.steps { margin: 32px auto 0; display: grid; gap: 8px; text-align: left; }
.step { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--paper); font-size: 15px; }
.step .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #fff; font: 400 12px var(--mono); color: var(--ink-60); }
.step.done .n { background: var(--accent); color: #fff; }
.step.now { background: var(--accent-soft); }
.step .s { font-size: 12px; color: var(--ink-40); }
.wallets { margin-top: 28px; display: grid; gap: 8px; }
.wallets button { height: 56px; padding: 0 18px; border-radius: 16px; background: var(--paper); display: flex; align-items: center; justify-content: space-between; font-size: 16px; font-weight: 500; transition: background-color .16s var(--ease); }
.wallets button:hover { background: var(--accent-soft); }
.wallets button > span:last-child { font-size: 13px; color: var(--ink-40); font-weight: 400; }
#root > .pane { height: 100%; }
.netpill { height: 44px; padding: 0 16px; display: inline-flex; align-items: center; gap: 10px; border-radius: var(--r-pill); background: var(--surface); box-shadow: 0 0 0 1px var(--line); font-size: 14px; color: var(--ink-60); }
.netpill i { width: 8px; height: 8px; border-radius: 50%; background: #1FA463; }
.wallets img { width: 28px; height: 28px; border-radius: 8px; }
.wallets .l { display: flex; align-items: center; gap: 12px; }

.newto { padding: 24px; border-bottom: 1px solid var(--line); }
.newto .lookup { margin-top: 12px; min-height: 22px; font-size: 14px; color: var(--ink-60); display: flex; align-items: center; gap: 8px; }
.newto .lookup .ok { color: var(--accent); }
.newto .lookup .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink-40); border-right-color: transparent; animation: spin .7s linear infinite; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 10px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--paper); border-radius: var(--r-pill); padding: 12px 20px; font-size: 14px; transition: opacity .18s var(--ease), transform .18s var(--ease); z-index: 60; max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.sk { background: var(--surface-2); border-radius: 10px; animation: pulse 1.1s var(--ease) infinite alternate; }
@keyframes pulse { from { opacity: .45; } to { opacity: 1; } }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .shell.thread-open .list { display: none; }
  .shell:not(.thread-open) .thread { display: none; }
  .composer-row { grid-template-columns: 1fr 110px; }
  .composer-row .btn { grid-column: 1 / -1; }
  .composer .hint .long { display: none; }
  .th-head { padding: 12px 12px 12px 8px; min-height: 64px; gap: 10px; }
  .msgs { padding: 16px; }
  .m { max-width: 86%; }
  #root { padding-top: 12px; padding-bottom: 12px; }
}
