:root {
  color-scheme: dark;
  --bg: #0b0d0f;
  --panel: #111417;
  --panel-2: #151a1d;
  --panel-3: #1c2225;
  --line: #283136;
  --line-soft: #1e262a;
  --text: #f4f7f5;
  --muted: #96a19c;
  --muted-2: #66726d;
  --accent: #30d5b0;
  --accent-2: #49a6ff;
  --amber: #d7ad57;
  --rose: #e06666;
  --green: #7bd88f;
  --shadow: rgba(0, 0, 0, 0.32);
  --header-actions-width: 204px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 161, 156, 0.42) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

*::-webkit-scrollbar-thumb {
  min-height: 36px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(150, 161, 156, 0.42);
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(48, 213, 176, 0.56);
  background-clip: content-box;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:disabled,
.settings-list button:disabled,
.action-grid button:disabled,
.icon-button:disabled,
.recipient-submit:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.settings-list button:disabled strong {
  color: var(--muted-2);
}

.settings-list button:disabled:hover,
.action-grid button:disabled:hover,
.icon-button:disabled:hover {
  border-color: var(--line);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background:
    linear-gradient(180deg, rgba(48, 213, 176, 0.05), transparent 280px),
    var(--bg);
}

.sidebar {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 24px;
  padding: 18px 12px;
  border-right: 1px solid var(--line-soft);
  background: rgba(11, 13, 15, 0.92);
}

.brand {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
}

.brand-name {
  display: none;
}

.network-pill {
  display: grid;
  place-items: center;
  gap: 4px;
  font-size: 10px;
  line-height: 1;
  color: var(--muted);
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(123, 216, 143, 0.14);
}

.rail {
  display: grid;
  align-content: start;
  gap: 8px;
}

.rail-item,
.icon-button,
.send-button,
.action-grid button,
.settings-list button {
  border: 1px solid transparent;
  cursor: pointer;
}

.rail-item {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 62px;
  padding: 9px 4px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.rail-item span:last-child {
  font-size: 11px;
  line-height: 1;
}

.rail-item.is-active {
  background: #17211f;
  border-color: rgba(48, 213, 176, 0.24);
  color: var(--text);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 392px) minmax(0, 1fr);
  min-width: 0;
  height: 100%;
}

.list-pane,
.content-pane {
  min-width: 0;
  min-height: 0;
}

.list-pane {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 22px;
  border-right: 1px solid var(--line-soft);
  background: rgba(17, 20, 23, 0.96);
}

.content-pane {
  display: none;
  background:
    linear-gradient(90deg, rgba(48, 213, 176, 0.04), transparent 380px),
    var(--panel);
}

.content-pane.is-active {
  display: grid;
}

.chat-pane {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.pane-header,
.conversation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pane-header > div:first-child,
.conversation-title {
  min-width: 0;
}

.pane-header h1,
.conversation-title h2,
.profile-pane h2,
.feed-item h2 {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0;
}

.pane-header h1 {
  font-size: 26px;
  line-height: 1.1;
}

.pane-header p,
.conversation-title p,
.profile-pane p,
.feed-item p,
.balance-card small,
.ledger-row small {
  margin: 4px 0 0;
  color: var(--muted);
}

.pane-header p,
.conversation-title p,
.balance-card small,
.ledger-row small {
  font-size: 13px;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: var(--header-actions-width);
}

.icon-button,
.send-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--panel-2);
  border-color: var(--line);
}

.icon-button:hover,
.send-button:hover,
.action-grid button:hover,
.settings-list button:hover {
  border-color: rgba(48, 213, 176, 0.42);
}

.icon-button.accent,
.send-button {
  background: var(--accent);
  color: #06100d;
  border-color: transparent;
}

.icon-button[hidden] {
  display: none;
}

.docs-header-button {
  width: 34px;
  height: 34px;
  background: #0d1012;
}

.search-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1012;
}

.action-search-row {
  grid-template-columns: 20px minmax(0, 1fr) 44px;
}

.public-channel-search-row[hidden] {
  display: none;
}

.action-search-row .icon-button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  justify-self: end;
}

.search-row input,
.composer textarea {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
}

.search-row input::placeholder,
.composer textarea::placeholder {
  color: var(--muted-2);
}

.thread-list {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.thread-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.thread-item:hover,
.thread-item.is-selected {
  background: var(--panel-2);
  border-color: var(--line);
}

.thread-main {
  min-width: 0;
}

.thread-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.thread-name,
.thread-time,
.thread-preview,
.thread-state {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-name {
  font-size: 15px;
  font-weight: 700;
}

.identity-label-wallet {
  color: var(--text);
}

.identity-label-ton {
  color: var(--accent-2);
}

.identity-label-platho {
  color: #f28a32;
}

.thread-time {
  justify-self: end;
  max-width: 72px;
  color: var(--muted);
  font-size: 12px;
}

.thread-preview {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.thread-state {
  margin-top: 6px;
  color: var(--accent);
  font-size: 11px;
  text-transform: uppercase;
}

.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #19221f;
  color: var(--accent);
  border: 1px solid rgba(48, 213, 176, 0.25);
  font-weight: 800;
  background-size: cover;
  background-position: center;
}

.avatar.has-image {
  color: transparent;
  text-shadow: none;
}

.avatar.large {
  width: 64px;
  height: 64px;
  font-size: 24px;
}

.feed-author-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.feed-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex: 0 0 30px;
  font-size: 12px;
}

.conversation-header {
  min-height: 78px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(15, 18, 20, 0.94);
}

.conversation-title {
  min-width: 0;
  margin-right: auto;
}

.chat-back-button {
  display: none;
}

.identity-title-label {
  display: block;
  max-width: min(56vw, 520px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-popover {
  position: fixed;
  z-index: 50;
  display: grid;
  gap: 8px;
  width: min(280px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111417;
  box-shadow: 0 18px 50px var(--shadow);
}

.identity-popover[hidden] {
  display: none;
}

.identity-popover-title {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.identity-variant {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.identity-variant:hover,
.identity-variant[aria-checked="true"] {
  border-color: rgba(48, 213, 176, 0.24);
  background: rgba(48, 213, 176, 0.08);
}

.identity-variant strong,
.identity-variant span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-variant strong {
  font-size: 13px;
}

.identity-variant span {
  color: var(--muted);
  font-size: 11px;
}

.conversation-title h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
}

.message-strip {
  display: grid;
  align-content: end;
  gap: 10px;
  overflow: auto;
  padding: 22px;
}

.message {
  display: grid;
  gap: 5px;
  max-width: min(620px, 82%);
}

.message.in {
  justify-self: start;
}

.message.out {
  justify-self: end;
}

.bubble {
  padding: 11px 13px;
  border-radius: 8px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  line-height: 1.38;
  font-size: 15px;
  white-space: pre-wrap;
}

.message.out .bubble {
  background: #13312b;
  border-color: rgba(48, 213, 176, 0.24);
}

.message.system {
  justify-self: center;
  max-width: min(560px, 92%);
}

.message.system .bubble {
  color: var(--muted);
  background: #101416;
  border-style: dashed;
  font-size: 13px;
}

.message-meta {
  color: var(--muted-2);
  font-size: 11px;
}

.message.out .message-meta {
  justify-self: end;
}

.payment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.payment-actions button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 13, 15, 0.62);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.payment-actions button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.composer {
  display: grid;
  grid-template-columns: 44px 44px minmax(0, 1fr) 52px;
  align-items: end;
  column-gap: 10px;
  row-gap: 6px;
  padding: 12px 20px env(safe-area-inset-bottom);
  border-top: 1px solid var(--line-soft);
  background: rgba(15, 18, 20, 0.96);
}

.composer textarea {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1012;
}

.composer textarea {
  max-height: 144px;
  padding: 11px 14px;
  resize: none;
  line-height: 1.35;
  overflow-y: hidden;
}

.composer textarea.is-scrollable {
  overflow-y: auto;
}

.composer-stack {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.composer-post-option {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.composer-post-option[hidden] {
  display: none;
}

.composer-post-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.composer-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(48, 213, 176, 0.08);
  color: var(--muted);
  font-size: 12px;
}

.composer-context[hidden] {
  display: none;
}

.composer-context button {
  min-height: 24px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.composer .send-button {
  width: 52px;
  height: 44px;
}

.composer .payment-check-button,
.composer .attachment-button {
  width: 44px;
  height: 44px;
}

.composer-attachment-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.composer-attachment-controls select,
.composer-attachment select {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1012;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.composer-attachment {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(48, 213, 176, 0.08);
  color: var(--muted);
  font-size: 12px;
}

.composer-attachment[hidden] {
  display: none;
}

.composer-attachment button {
  min-height: 26px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.message-image,
.feed-image {
  display: block;
  width: 100%;
  max-width: 320px;
  max-height: 360px;
  margin-top: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  object-fit: contain;
  background: #0d1012;
}

.composer-cost-status {
  grid-column: 1 / -1;
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-line;
}

.composer-cost-status[data-state="short"] {
  color: var(--amber);
}

.composer-cost-status[data-state="ready"] {
  color: var(--muted);
}

.composer[data-read-only="true"] {
  display: none;
}

.public-composer[hidden] {
  display: none;
}

.public-composer {
  grid-template-columns: minmax(0, 1fr) 72px;
  column-gap: 14px;
  padding: 18px 0 0;
  background: transparent;
}

.public-composer .composer-stack {
  grid-column: 1;
  gap: 10px;
}

.public-composer > .send-button {
  grid-column: 2;
  width: 72px;
  height: 66px;
}

.public-composer[data-mode="comment"] {
  grid-template-columns: minmax(0, 1fr) 72px;
}

.public-composer .send-button {
  align-self: start;
}

.public-composer textarea {
  min-height: 66px;
}

.public-composer .composer-cost-status {
  padding-left: 31px;
}

.public-pane,
.vault-pane,
.profile-pane {
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  overflow: hidden;
  padding: 24px;
}

.public-pane {
  position: relative;
}

.vault-pane {
  align-content: start;
  grid-template-rows: none;
  overflow: auto;
}

.profile-pane {
  align-content: start;
  grid-template-rows: none;
  overflow: auto;
}

.pane-header.inline {
  border-bottom: 0;
  padding-bottom: 0;
}

.public-feed,
.ledger,
.settings-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.public-feed {
  overflow: auto;
  padding-right: 4px;
}

.public-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: var(--header-actions-width);
}

.segmented-control {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1012;
}

.segmented-control button,
.mini-action-button,
.public-jump-down-button {
  min-height: 34px;
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.segmented-control button {
  height: 34px;
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  background: transparent;
}

.segmented-control button[aria-pressed="true"] {
  background: rgba(48, 213, 176, 0.14);
  color: var(--accent);
}

.mini-action-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: rgba(10, 13, 15, 0.62);
}

.mini-action-button[hidden] {
  display: none;
}

.public-jump-down-button {
  position: absolute;
  right: 32px;
  bottom: calc(118px + env(safe-area-inset-bottom));
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(48, 213, 176, 0.3);
  background: rgba(13, 16, 18, 0.92);
  box-shadow: 0 14px 34px var(--shadow);
  backdrop-filter: blur(12px);
}

.public-jump-down-button:hover {
  border-color: rgba(48, 213, 176, 0.58);
  color: var(--accent);
}

.public-jump-down-button[hidden] {
  display: none;
}

.feed-item {
  display: block;
  width: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
}

.feed-item.is-unread {
  border-color: rgba(48, 213, 176, 0.42);
}

button.feed-item {
  cursor: pointer;
}

button.feed-item:hover {
  border-color: rgba(48, 213, 176, 0.36);
  background: #171d1f;
}

.feed-item.compact {
  padding: 14px 18px;
}

.feed-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.feed-item h2 {
  margin-top: 10px;
  font-size: 18px;
}

.feed-item p {
  line-height: 1.45;
}

.comment-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.comment-item {
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(8, 11, 13, 0.42);
}

.comment-item p {
  margin-top: 6px;
  color: var(--text);
  font-size: 14px;
}

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

.feed-actions button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 13, 15, 0.62);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.feed-actions button:hover {
  border-color: rgba(48, 213, 176, 0.42);
  color: var(--accent);
}

.feed-actions button:disabled {
  cursor: not-allowed;
  color: var(--muted);
  border-color: var(--line-soft);
  opacity: 0.76;
}

.feed-actions button:disabled:hover {
  color: var(--muted);
  border-color: var(--line-soft);
}

.balance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 10px;
}

.balance-grid[hidden],
.action-grid[hidden],
.ledger[hidden] {
  display: none;
}

.balance-card {
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.balance-card span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.balance-card strong {
  display: block;
  margin-top: 18px;
  font-size: 30px;
  line-height: 1;
}

.balance-card.warn strong {
  color: var(--amber);
}

.vault-pocket-note {
  display: grid;
  gap: 4px;
  margin: 10px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 7%, var(--panel-2));
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.vault-pocket-note strong {
  color: var(--text);
}

.vault-move-list {
  display: grid;
  gap: 12px;
}

.vault-asset-move-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}

.vault-asset-move-card:focus-within {
  border-color: rgba(48, 213, 176, 0.55);
  box-shadow: 0 0 0 1px rgba(48, 213, 176, 0.16) inset;
}

.vault-asset-move-header,
.vault-asset-move-body {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.vault-asset-move-header span,
.vault-asset-route span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.vault-asset-move-header strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.vault-asset-balances {
  display: grid;
  gap: 5px;
  justify-items: end;
  color: var(--muted);
  font-size: 13px;
}

.vault-asset-balances strong {
  display: inline;
  margin: 0 0 0 6px;
  color: var(--text);
  font-size: 13px;
}

.vault-asset-route {
  display: grid;
  grid-template-columns: minmax(68px, auto) 42px minmax(68px, auto);
  align-items: center;
  gap: 9px;
  justify-self: start;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #0d1012;
}

.vault-asset-route span {
  color: var(--text);
  text-align: center;
  text-transform: none;
}

.vault-asset-switch {
  width: 42px;
  height: 42px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel-3);
  color: var(--accent);
}

.vault-asset-switch .icon {
  width: 13px;
  height: 13px;
}

.vault-asset-amount {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-self: end;
  gap: 8px;
  min-width: min(300px, 100%);
}

.vault-asset-amount input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: clamp(34px, 7vw, 52px);
  line-height: 1;
  text-align: right;
}

.vault-asset-amount input::placeholder {
  color: var(--muted-2);
}

.vault-asset-amount button {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-3);
  color: var(--accent);
  font-weight: 900;
}

.vault-move-submit {
  min-height: 50px;
  border-radius: 8px;
  border-color: transparent;
  background: var(--accent);
  color: #07110f;
  font-size: 17px;
  font-weight: 900;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 10px;
  margin-top: 10px;
}

.action-grid button,
.settings-list button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  border-radius: 8px;
  background: var(--panel-2);
  border-color: var(--line);
}

.ledger-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.ledger-row div {
  min-width: 0;
}

.ledger-row strong,
.ledger-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.ledger-icon.green {
  background: var(--green);
}

.ledger-icon.cyan {
  background: var(--accent-2);
}

.ledger-icon.amber {
  background: var(--amber);
}

.identity-block {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 0 4px;
}

.profile-sections {
  display: grid;
  gap: 18px;
}

.profile-section {
  display: grid;
  gap: 10px;
}

.profile-section h2 {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-list button,
.settings-select-row {
  justify-content: space-between;
  padding: 0 16px;
}

.profile-stat-list {
  display: grid;
  gap: 8px;
}

.profile-stat-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.settings-list span {
  color: var(--muted);
}

.settings-list strong,
.profile-stat-row strong {
  justify-self: end;
  text-align: right;
  white-space: nowrap;
  font-size: 14px;
}

.profile-stat-row span {
  color: var(--muted);
}

.settings-select-row {
  display: grid;
  grid-template-columns: minmax(76px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 12px;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.settings-select-row.compact-select-row {
  grid-template-columns: minmax(150px, auto) minmax(0, 1fr);
}

.settings-select-row strong {
  justify-self: end;
  color: var(--text);
  white-space: nowrap;
}

.settings-select-row select {
  min-width: 0;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 34px 0 12px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.48);
}

.modal-backdrop[hidden] {
  display: none;
}

.recipient-dialog,
.action-dialog,
.docs-dialog {
  display: grid;
  gap: 14px;
  width: min(440px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 50px var(--shadow);
}

.docs-dialog {
  grid-template-rows: auto minmax(0, 1fr);
  width: min(980px, 100%);
  height: min(760px, 86dvh);
}

.recipient-dialog header,
.action-dialog header,
.docs-dialog header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.recipient-dialog h2,
.recipient-dialog p,
.action-dialog h2,
.action-dialog p,
.docs-dialog h2,
.docs-dialog p {
  margin: 0;
}

.recipient-dialog h2,
.action-dialog h2,
.docs-dialog h2 {
  font-size: 18px;
  letter-spacing: 0;
}

.recipient-dialog p,
.action-dialog p,
.docs-dialog header p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.recipient-dialog p[data-tone="error"],
.action-dialog p[data-tone="error"] {
  color: var(--rose);
}

.recipient-dialog input,
.action-dialog input,
.action-dialog select,
.action-dialog textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: var(--panel-2);
  outline: 0;
}

.action-dialog textarea {
  min-height: 108px;
  padding: 12px;
  resize: vertical;
  line-height: 1.4;
}

.recipient-dialog input:focus,
.action-dialog input:focus,
.action-dialog select:focus,
.action-dialog textarea:focus {
  border-color: rgba(48, 213, 176, 0.6);
}

.action-fields {
  display: grid;
  gap: 10px;
}

.action-field {
  display: grid;
  gap: 6px;
}

.action-field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.action-summary {
  display: grid;
  gap: 6px;
  min-height: 42px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(8, 11, 13, 0.64);
  color: var(--muted);
  font-size: 13px;
}

.action-summary strong {
  color: var(--text);
}

.recipient-submit {
  height: 42px;
  border: 1px solid rgba(48, 213, 176, 0.3);
  border-radius: 8px;
  color: #061411;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}

.docs-layout {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  min-height: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(8, 11, 13, 0.38);
}

.docs-nav {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 10px;
  border-right: 1px solid var(--line-soft);
  background: rgba(13, 16, 18, 0.72);
}

.docs-nav button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 11px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.docs-nav button:hover,
.docs-nav button.is-active {
  color: var(--text);
  border-color: rgba(48, 213, 176, 0.28);
  background: rgba(48, 213, 176, 0.08);
}

.docs-content {
  min-width: 0;
  overflow: auto;
  padding: 18px 20px 24px;
  outline: 0;
}

.docs-status {
  color: var(--muted);
  font-size: 14px;
}

.docs-status-error {
  color: var(--rose);
}

.docs-rendered {
  max-width: 760px;
  line-height: 1.64;
  color: var(--text);
}

.docs-rendered h2,
.docs-rendered h3,
.docs-rendered h4,
.docs-rendered h5 {
  margin: 24px 0 10px;
  line-height: 1.2;
  letter-spacing: 0;
}

.docs-rendered h2:first-child {
  margin-top: 0;
}

.docs-rendered h2 {
  font-size: 24px;
}

.docs-rendered h3 {
  font-size: 18px;
}

.docs-rendered h4,
.docs-rendered h5 {
  font-size: 15px;
}

.docs-rendered p,
.docs-rendered ul,
.docs-rendered ol,
.docs-rendered pre,
.docs-table-wrap {
  margin: 0 0 15px;
}

.docs-rendered ul,
.docs-rendered ol {
  padding-left: 22px;
}

.docs-rendered li + li {
  margin-top: 6px;
}

.docs-rendered code {
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 1px 5px;
  background: rgba(255, 255, 255, 0.04);
  color: #dfeee8;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.docs-rendered pre {
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: #090c0e;
}

.docs-rendered pre code {
  display: block;
  border: 0;
  padding: 0;
  background: transparent;
  white-space: pre;
}

.docs-rendered a {
  color: var(--accent-2);
}

.docs-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.docs-rendered table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 13px;
}

.docs-rendered th,
.docs-rendered td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.docs-rendered th {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  text-transform: uppercase;
}

.docs-rendered tr:last-child td {
  border-bottom: 0;
}

.icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: var(--mask) center / contain no-repeat;
  mask: var(--mask) center / contain no-repeat;
}

.icon-chat { --mask: url("./assets/icons/chat.svg"); }
.icon-broadcast { --mask: url("./assets/icons/broadcast.svg"); }
.icon-vault { --mask: url("./assets/icons/vault.svg"); }
.icon-user { --mask: url("./assets/icons/user.svg"); }
.icon-search { --mask: url("./assets/icons/search.svg"); }
.icon-plus { --mask: url("./assets/icons/plus.svg"); }
.icon-down { --mask: url("./assets/icons/down.svg"); }
.icon-up { --mask: url("./assets/icons/up.svg"); }
.icon-back { --mask: url("./assets/icons/back.svg"); }
.icon-chevron-down { --mask: url("./assets/icons/chevron-down.svg"); }
.icon-refresh { --mask: url("./assets/icons/refresh.svg"); }
.icon-bolt { --mask: url("./assets/icons/bolt.svg"); }
.icon-gear { --mask: url("./assets/icons/gear.svg"); }
.icon-info { --mask: url("./assets/icons/info.svg"); }

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    max-width: 100vw;
    height: 100dvh;
    overflow: hidden;
  }

  .sidebar {
    grid-column: 1;
    grid-row: 2;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--line-soft);
  }

  .brand {
    display: none;
  }

  .rail {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  .rail-item {
    min-height: 54px;
    min-width: 0;
    padding-inline: 2px;
  }

  .workspace {
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100vw;
    min-width: 0;
    overflow: hidden;
  }

  .list-pane {
    display: none;
    width: 100%;
    max-width: 100vw;
  }

  .app-shell[data-view="chats"] .list-pane {
    display: grid;
  }

  .app-shell[data-view="chats"] .chat-pane {
    display: none;
  }

  .app-shell[data-chat-open="true"][data-view="chats"] .list-pane {
    display: none;
  }

  .app-shell[data-chat-open="true"][data-view="chats"] .chat-pane {
    display: grid;
  }

  .content-pane {
    min-height: 0;
  }

  .public-pane,
  .vault-pane,
  .profile-pane,
  .list-pane {
    padding: 18px 16px;
  }

  .pane-header {
    gap: 10px;
  }

  .header-actions {
    gap: 6px;
    min-width: var(--header-actions-width);
  }

  .icon-button,
  .send-button {
    width: 38px;
    height: 38px;
  }

  .public-header-actions {
    min-width: var(--header-actions-width);
  }

  .segmented-control {
    min-height: 38px;
  }

  .segmented-control button {
    height: 38px;
    min-height: 38px;
  }

  .conversation-header {
    padding: 12px 14px;
    gap: 10px;
  }

  .chat-back-button {
    display: grid;
  }

  .message-strip {
    padding: 16px 14px;
  }

  .composer {
    padding-inline: 14px;
  }

  .public-composer {
    padding-inline: 0;
  }

  .balance-grid,
  .vault-asset-move-header,
  .vault-asset-move-body,
  .action-grid {
    grid-template-columns: 1fr;
  }

  .vault-asset-balances {
    justify-items: start;
  }

  .vault-asset-route,
  .vault-asset-amount {
    width: 100%;
    justify-self: stretch;
  }

  .vault-asset-amount input {
    text-align: left;
  }

  .docs-dialog {
    height: min(820px, 92dvh);
    padding: 14px;
  }

  .docs-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .docs-nav {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .docs-nav button {
    min-width: 84px;
    text-align: center;
  }

  .docs-content {
    padding: 16px;
  }

  .docs-rendered table {
    min-width: 480px;
  }
}

@media (min-width: 901px) {
  .app-shell[data-view="chats"] .chat-pane {
    display: grid;
  }

  .app-shell:not([data-view="chats"]) .list-pane {
    display: none;
  }

  .app-shell:not([data-view="chats"]) .workspace {
    grid-template-columns: minmax(0, 1fr);
  }
}
