:root {
  color-scheme: dark;
  --bg: #10243a;
  --bg-deep: #0b1d31;
  --header: #17314d;
  --row: #1b3856;
  --row-active: #244b72;
  --line: rgba(119, 190, 255, .13);
  --text: #edf7ff;
  --muted: #8fb4d3;
  --accent: #51b8ff;
  --accent-strong: #2aa5f7;
  --incoming: #18304a;
  --outgoing: #2a6da2;
  --field: #183553;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--text);
  font: 15px/1.35 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  color: inherit;
}

.app-header {
  height: 58px;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  background: var(--header);
  border-bottom: 1px solid var(--line);
}

.header-title {
  min-width: 0;
  text-align: center;
}

h1,
p {
  margin: 0;
}

h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 650;
}

#status {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
}

.header-btn {
  width: 48px;
  height: 48px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.header-btn.hidden {
  visibility: hidden;
}

.page-host {
  position: relative;
  height: calc(100% - 58px);
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

.page {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  transform: translateX(0);
  transition: transform 240ms cubic-bezier(.2, .8, .2, 1);
  will-change: transform;
}

.page.enter-from-right {
  transform: translateX(100%);
}

.page.enter-from-left {
  transform: translateX(-100%);
}

.page.exit-to-left {
  transform: translateX(-32%);
}

.page.exit-to-right {
  transform: translateX(100%);
}

.list-page {
  padding: 10px 0;
}

.list-page.compact {
  padding-top: 0;
}

.list-row {
  position: relative;
  display: block;
  width: 100%;
  min-height: 60px;
  padding: 11px 44px 11px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--row);
  text-align: left;
  cursor: pointer;
}

.list-row::after {
  content: "›";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-52%);
  color: var(--muted);
  font-size: 25px;
}

.list-row:active,
.list-row.active {
  background: var(--row-active);
}

.row-content {
  display: block;
  min-width: 0;
  padding-right: 34px;
}

.row-main,
.row-sub {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-main {
  color: var(--text);
  font-weight: 570;
}

.row-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  position: absolute;
  right: 42px;
  top: 50%;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff3b4f;
  color: #fff;
  font-size: 12px;
  font-weight: 750;
  line-height: 20px;
  text-align: center;
  transform: translateY(-50%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .24);
}

.empty-row {
  margin: 12px 14px;
  padding: 14px;
  color: var(--muted);
  background: rgba(27, 56, 86, .74);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.chat-page {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.bubble {
  max-width: min(78%, 540px);
  padding: 8px 9px 5px;
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .16);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bubble.incoming {
  align-self: flex-start;
  background: var(--incoming);
  border-bottom-left-radius: 3px;
}

.bubble.outgoing {
  align-self: flex-end;
  background: var(--outgoing);
  border-bottom-right-radius: 3px;
}

.bubble-time {
  float: right;
  margin: 5px 0 0 8px;
  color: rgba(237, 247, 255, .62);
  font-size: 11px;
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 8px;
  background: var(--header);
  border-top: 1px solid var(--line);
}

textarea,
input,
select {
  width: 100%;
  color: var(--text);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  outline: none;
}

textarea {
  min-height: 42px;
  max-height: 110px;
  resize: none;
}

.composer button,
.primary,
.promo-row button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: var(--accent-strong);
  color: #fff;
  font-weight: 650;
  cursor: pointer;
}

.toolbar {
  padding: 12px 14px;
}

.toolbar .primary,
.form-page .primary {
  width: 100%;
  min-height: 44px;
}

.promo-list {
  padding-bottom: 16px;
}

.promo-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--row);
  border-bottom: 1px solid var(--line);
}

.promo-row.inactive {
  opacity: .58;
}

.promo-copy {
  min-width: 0;
}

.promo-copy strong,
.promo-copy span,
.promo-copy small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.promo-copy small {
  margin-top: 3px;
  color: var(--muted);
}

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

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 14px;
}

.segment {
  min-height: 38px;
  border: 1px solid rgba(81, 184, 255, .7);
  border-radius: 8px;
  background: rgba(27, 56, 86, .58);
  color: var(--accent);
}

.segment.active {
  background: var(--accent-strong);
  color: #fff;
}

@media (min-width: 760px) {
  #app {
    max-width: 760px;
    margin: 0 auto;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }
}
