:root {
  --text-muted: #a49db2;
  --bg-header: #0e0b19;
  --bg-blur: rgba(18, 14, 30, 0.6);
  --menu-bg: rgba(27, 21, 45, 0.6);
  --menu-text: #ffffff;
  --knot-card-bg: #1b152d;
  --knot-card-title: #efedf3;
  --knot-card-members: #9c91c0;
  --knot-card-icon-bg: #09070f;
  --bg-surface-secondary: #241c3c;
  --input-bg: #171322;
  --input-border-focus: #7b6cab;
  --text-secondary-inverse: #612f34;
  --border-default: #2d2639;
}

.screen--app {
  display: flex;
  flex-direction: column;
  background: var(--bg-canvas);
}

.app-header {
  position: absolute;
  top: 38px;
  left: 0;
  right: 0;
  height: 80px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(15px);
  background: var(--bg-blur);
  z-index: 2;
}

.app-logo {
  position: relative;
  width: 88px;
  height: 38px;
  overflow: hidden;
}

.app-logo .logo-layer {
  position: absolute;
  display: block;
  max-width: none;
}

.app-logo .logo-sp {
  inset: 19.92% 51.15% 0 0;
  width: 43px;
  height: 30px;
}

.app-logo .logo-oo {
  inset: 19.92% 14.6% 21.83% 51.53%;
  width: 30px;
  height: 22px;
}

.app-logo .logo-l {
  inset: 0 0 24.21% 88.08%;
  width: 10px;
  height: 29px;
}

.profile-btn {
  width: 48px;
  height: 48px;
  padding: 8px;
  border: none;
  border-radius: 24px;
  background: var(--input-bg);
  cursor: pointer;
}

.profile-btn img {
  width: 28.8px;
  height: 28.8px;
  display: block;
  margin-left: 1.6px;
  margin-top: 1.6px;
  object-fit: cover;
}

.app-scroll {
  position: absolute;
  top: 126px;
  left: 24px;
  right: 24px;
  bottom: 100px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}

.app-scroll::-webkit-scrollbar {
  display: none;
}

.screen--app.screen--no-tabs .app-scroll {
  bottom: 0;
}

.screen--app.screen--has-bottom .app-scroll {
  bottom: 94px;
}

.list-section-title {
  margin: 0 0 8px;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-muted);
}

.list-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.search-pill {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  height: 64px;
  padding: 22px 24px;
  border: none;
  border-radius: 50px;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  cursor: pointer;
  flex: 1;
  max-width: 189px;
  text-align: left;
}

.search-pill img {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.search-pill span {
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 20px;
  color: var(--input-placeholder);
}

.search-pill--wide {
  max-width: none;
  width: 100%;
}

.search-pill--focus {
  border: 1px solid var(--input-border-focus);
  align-items: center;
}

.search-pill--focus span {
  color: var(--input-text);
}

.btn-secondary-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  padding: 17px 18px 16px 19px;
  border: 2px solid var(--button-secondary-text);
  border-radius: 32px;
  background: transparent;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 20px;
  color: var(--button-secondary-text);
  cursor: pointer;
  flex: 1;
  max-width: 189px;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.knot-card {
  display: flex;
  align-items: center;
  min-height: 82px;
  border-radius: 24px;
  background: var(--knot-card-bg);
  overflow: hidden;
}

.knot-card[hidden] {
  display: none;
}

.knot-card__main {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 1;
  padding: 12px 12px 12px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: inherit;
}

.knot-card__icon {
  flex-shrink: 0;
  width: 58px;
  height: 58px;
  border-radius: 29px;
  background: var(--knot-card-icon-bg);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.knot-card__icon img {
  width: 26px;
  height: 24px;
  object-fit: cover;
}

.knot-card__icon--initials {
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: var(--text-secondary);
}

.knot-card__body {
  flex: 1;
  min-width: 0;
}

.knot-card__title {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 20px;
  color: var(--knot-card-title);
}

.knot-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.knot-card__subtitle {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 20px;
  color: var(--knot-card-members);
}

.badge-unread {
  position: relative;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.badge-unread img {
  width: 20px;
  height: 20px;
}

.badge-unread span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 12px;
  color: var(--knot-card-title);
}

.knot-card__rail {
  flex-shrink: 0;
  width: 120px;
  height: 82px;
  display: grid;
  place-items: center;
  background: var(--bg-surface-secondary);
  border-radius: 0 24px 24px 0;
}

.knot-card__rail img {
  width: 92px;
  height: 46px;
}

.knot-card--tie .knot-card__main {
  width: 100%;
}

.collection-thumb {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  flex-shrink: 0;
}

.collection-thumb span {
  background: linear-gradient(135deg, #5a4796, #e09da3);
  opacity: 0.85;
}

.collection-thumb span:nth-child(2) {
  background: linear-gradient(135deg, #362b5a, #9c91c0);
}

.collection-thumb span:nth-child(3) {
  background: linear-gradient(135deg, #612f34, #ecc4c8);
}

.collection-thumb span:nth-child(4) {
  background: linear-gradient(135deg, #1b152d, #7b6cab);
}

.tab-bar {
  position: absolute;
  left: 40px;
  bottom: 16px;
  width: 360px;
  height: 80px;
  padding: 15px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 80px;
  backdrop-filter: blur(15px);
  background: var(--menu-bg);
  z-index: 3;
}

.tab-bar__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-evenly;
  width: 100%;
}

.tab-bar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 110px;
  width: 110px;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0.5;
  padding: 0;
}

.tab-bar__item.is-active {
  opacity: 1;
}

.tab-bar__icon {
  position: relative;
  width: 48px;
  height: 48px;
  overflow: hidden;
}

.tab-bar__icon img {
  position: absolute;
  width: 169.77%;
  height: 180.72%;
  left: -34.88%;
  top: -37.13%;
  max-width: none;
}

.tab-bar__icon img.tab-ties {
  width: 148.98%;
  height: 197.48%;
  left: -24.49%;
  top: -48.74%;
}

.tab-bar__icon img.tab-collections {
  width: 153.19%;
  height: 153.19%;
  left: -26.6%;
  top: -26.6%;
}

.tab-bar__label {
  margin: 0;
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  font-size: 12px;
  line-height: 20px;
  color: var(--menu-text);
  text-align: center;
}

.page-header-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 64px 24px 16px;
  background: var(--bg-header);
  z-index: 2;
}

.page-header {
  position: relative;
  height: 47px;
  width: 100%;
  max-width: 392px;
  margin: 0 auto;
}

.page-header__title {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 20px;
  color: var(--text-secondary);
  text-align: center;
  pointer-events: none;
}

.page-header__title--light {
  color: var(--knot-card-title);
}

.page-header__back {
  position: absolute;
  left: 0;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.page-header__back img {
  width: 32px;
  height: 32px;
}

.page-header__plus {
  position: absolute;
  right: 0;
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  width: 37px;
  height: 37px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.page-header__plus img {
  width: 37px;
  height: 37px;
}

.page-header__step {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 71px;
  height: 41px;
  padding: 0;
  box-sizing: border-box;
  border: 1.5px solid var(--text-secondary);
  border-radius: 20.5px;
  backdrop-filter: blur(20px);
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
  background: transparent;
  z-index: 1;
}

.screen--app.screen--flow .app-scroll {
  top: 127px;
}

#create-knot-contacts .app-scroll {
  top: 234px;
}

.screen--app.screen--flow-search .app-scroll {
  top: 234px;
}

.screen--app.screen--strand .app-scroll {
  top: 224px;
}

.strand-tabs {
  position: absolute;
  top: 144px;
  left: 50%;
  display: flex;
  width: 392px;
  transform: translateX(-50%);
  z-index: 1;
}

.strand-tabs .auth-tab {
  flex: 0 0 196px;
  width: 196px;
}

.knot-card--strand .knot-card__icon img {
  width: 40px;
  height: 40px;
  object-fit: cover;
}

.knot-card--strand .knot-card__main {
  width: 100%;
  padding-right: 16px;
}

.knot-card--strand .knot-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.knot-card--strand .knot-card__meta {
  width: 100%;
  margin-top: 0;
  justify-content: space-between;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  height: 64px;
  margin-bottom: 16px;
  padding: 0 24px;
  border: 1px solid var(--input-border-focus);
  border-radius: 50px;
  background: var(--bg-surface);
  box-sizing: border-box;
}

.search-field__back {
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.search-field__back img {
  width: 20px;
  height: 20px;
  display: block;
}

.search-field__query {
  flex: 1;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: text;
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  line-height: 20px;
  color: var(--input-text, #fff);
  text-align: left;
}

.search-caret {
  display: inline-block;
  width: 1px;
  height: 18px;
  margin-left: 1px;
  background: var(--input-text, #fff);
}

.flow-search-stack {
  position: absolute;
  top: 98px;
  left: 0;
  right: 0;
  padding: 40px 24px 16px;
  background: var(--bg-header);
  z-index: 1;
}

.flow-search-stack--step2 {
  top: 127px;
  padding-top: 0;
}

.selected-contacts {
  display: flex;
  gap: 24px;
  margin-top: 21px;
}

.selected-chip {
  width: 50px;
  text-align: center;
}

.selected-chip__avatar {
  position: relative;
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  background: var(--knot-card-icon-bg);
}

.selected-chip__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.selected-chip__avatar--initials {
  display: grid;
  place-items: center;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: var(--text-muted);
}

.selected-chip__label {
  margin: 4px 0 0;
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-secondary);
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 59px;
  padding-bottom: 1px;
  border-bottom: 1px solid var(--border-default);
  background: transparent;
  border-left: none;
  border-right: none;
  border-top: none;
  width: 100%;
  cursor: pointer;
  text-align: left;
  color: inherit;
}

.contact-row__avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--knot-card-icon-bg);
  display: grid;
  place-items: center;
}

.contact-row__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact-row__name {
  flex: 1;
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  font-size: 18px;
  line-height: 20px;
  color: var(--text-secondary);
}

.contact-row__check {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.flow-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 94px;
  padding: 29px 12px;
  backdrop-filter: blur(15px);
  background: var(--menu-bg);
  z-index: 3;
}

.flow-bottom__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.flow-bottom__btn {
  flex: 1;
  height: 36px;
  border: none;
  background: transparent;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 20px;
  color: var(--button-primary-bg);
  cursor: pointer;
}

.flow-bottom__btn:disabled,
.flow-bottom__btn.is-muted {
  opacity: 0.5;
}

.flow-bottom__divider {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2px;
  height: 34px;
  background: none;
}

.flow-bottom__divider img {
  transform: rotate(90deg);
}

.knot-details-scroll {
  top: 127px;
  bottom: 94px;
}

.details-avatar {
  width: 84px;
  height: 84px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: var(--bg-surface);
  border: 1px dashed var(--input-border);
  display: grid;
  place-items: center;
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  color: var(--text-muted);
}

.field-large {
  width: 100%;
  height: 64px;
  margin-bottom: 24px;
  padding: 0 24px;
  border: none;
  border-radius: 16px;
  background: var(--bg-surface);
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  color: var(--input-text);
}

.field-large::placeholder {
  color: var(--input-placeholder);
}

.details-label {
  margin: 0 0 12px;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-muted);
}

.member-row {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
}

.member-chip {
  width: 50px;
  text-align: center;
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
}

.member-chip__circle {
  width: 48px;
  height: 48px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: var(--knot-card-icon-bg);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 37px;
  padding: 8px 0;
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  color: var(--text-secondary);
}

.toggle {
  position: relative;
  width: 64px;
  height: 37px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle__track {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: var(--input-border);
  cursor: pointer;
}

.toggle input:checked + .toggle__track {
  background: var(--button-switcher-bg);
}

.toggle__track::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: var(--menu-text);
  transition: transform 0.15s ease;
}

.toggle input:checked + .toggle__track::after {
  transform: translateX(27px);
}

html[data-theme="light"] {
  --bg-canvas: #eeedf4;
  --text-error: #913737;
  --bg-surface: #ffffff;
  --bg-header: #eeedf4;
  --bg-blur: rgba(238, 237, 244, 0.6);
  --menu-bg: rgba(222, 218, 234, 0.6);
  --menu-text: #171322;
  --text-muted: #5f566e;
  --text-primary: #171322;
  --text-secondary: #171322;
  --input-bg: #ffffff;
  --input-text: #171322;
  --input-placeholder: #776e8c;
  --input-border: #c4c0cc;
  --input-border-focus: #5a4796;
  --border-default: #c4c0cc;
  --bg-surface-secondary: #dedaea;
  --knot-card-bg: #ffffff;
  --knot-card-title: #171322;
  --knot-card-members: #483978;
  --knot-card-icon-bg: #efedf3;
  --button-primary-bg: #362b5a;
  --button-primary-text: #ffffff;
  --button-secondary-text: #362b5a;
  --button-switcher-bg: #362b5a;
  --button-switcher-text: #ffffff;
  --text-secondary-inverse: #362b5a;
}

.form-error,
.hint,
.empty-copy {
  margin: 8px 0 0;
  font-family: "Montserrat", sans-serif;
  font-size: 14px;
  line-height: 20px;
  color: var(--text-muted);
}

.form-error {
  color: var(--text-error);
}

.settings-scroll {
  top: 140px;
}

.settings-row,
.text-link {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
  padding: 14px 0;
  border: none;
  border-bottom: 1px solid var(--border-default);
  background: transparent;
  color: var(--knot-card-title);
  font-family: "Montserrat", sans-serif;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
}

.settings-row span,
.text-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.settings-row small,
.contact-row small {
  color: var(--text-muted);
  font-size: 13px;
}

.settings-row.is-on strong {
  color: var(--button-primary-bg);
}

.seg {
  display: flex;
  border: 1px solid var(--border-default);
  border-radius: 16px;
  overflow: hidden;
}

.seg button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: "Montserrat", sans-serif;
  padding: 8px 12px;
  cursor: pointer;
}

.seg button.is-on {
  background: var(--button-switcher-bg);
  color: var(--button-switcher-text);
}

.person-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--knot-card-title);
  font-family: "Montserrat", sans-serif;
}

.person-hero .contact-row__avatar {
  width: 72px;
  height: 72px;
}

.btn-primary.block,
.block {
  width: 100%;
  margin-top: 16px;
}

.mini {
  border: none;
  background: transparent;
  color: var(--button-primary-bg);
  font-family: "Montserrat", sans-serif;
  cursor: pointer;
}

.profile-btn {
  position: relative;
}

.profile-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--button-primary-bg);
}

.chat-scroll {
  position: absolute;
  top: 140px;
  left: 24px;
  right: 24px;
  bottom: 92px;
  overflow: auto;
}

.chat-menu {
  position: absolute;
  top: 78px;
  right: 24px;
  z-index: 3;
  border: none;
  background: transparent;
  color: var(--button-primary-bg);
  font-family: "Montserrat", sans-serif;
  cursor: pointer;
}

.composer {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 24px;
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 3;
}

.composer input {
  flex: 1;
  height: 48px;
  border-radius: 24px;
  border: 1px solid var(--input-border);
  background: var(--bg-surface);
  color: var(--input-text);
  padding: 0 16px;
  font-family: "Montserrat", sans-serif;
}

.composer button,
.knot-card__rail button {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 20px;
  background: transparent;
  color: var(--button-primary-bg);
  cursor: pointer;
  font-size: 18px;
}

.bubble {
  margin: 0 0 12px;
  padding: 12px;
  border-radius: 16px;
  background: var(--bg-surface);
  color: var(--knot-card-title);
  font-family: "Montserrat", sans-serif;
}

.bubble.mine {
  background: var(--bg-surface-secondary);
}

.bubble__who,
.bubble__actions,
.reply-ref {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.bubble__actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.bubble__actions button,
.poll-option,
.check-item {
  border: none;
  background: transparent;
  color: var(--button-primary-bg);
  font-family: "Montserrat", sans-serif;
  cursor: pointer;
  text-align: left;
}

.check-item,
.poll-option {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  color: var(--knot-card-title);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.prompt-chip {
  border: 1px solid var(--button-primary-bg);
  border-radius: 24px;
  background: transparent;
  color: var(--button-primary-bg);
  font-family: "Montserrat", sans-serif;
  padding: 10px 14px;
  cursor: pointer;
}

.reply-banner {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 78px;
  margin: 0;
  color: var(--text-muted);
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
}

.field-large.hours,
.field-large.area {
  width: 140px;
  height: 48px;
  margin: 0;
}

.field-large.area {
  width: 100%;
  height: 96px;
  padding-top: 12px;
}

.selected-contacts .contact-row__avatar {
  width: 48px;
  height: 48px;
}
