:root {
  color-scheme: light;
  --chat-ink: #172033;
  --chat-muted: #68758a;
  --chat-primary: #6558d3;
  --chat-primary-dark: #4b40b4;
  --chat-surface: #ffffff;
  --chat-page: #f3f5fb;
  --chat-border: #e3e7f0;
  --chat-shadow: 0 24px 70px rgba(27, 38, 67, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

fieldset {
  min-width: 0;
}

body {
  min-height: 100vh;
  margin: 0;
  padding: 1.5rem;
  color: var(--chat-ink);
  background:
    radial-gradient(ellipse at 12% 4%, rgba(101, 88, 211, 0.11), transparent 34rem),
    radial-gradient(ellipse at 92% 92%, rgba(41, 183, 166, 0.1), transparent 30rem),
    var(--chat-page) !important;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
}

a {
  color: var(--chat-primary);
  transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

a:hover {
  color: var(--chat-primary-dark);
}

button,
input,
textarea,
select {
  font: inherit;
}

.auter {
  width: min(100%, 34rem) !important;
  height: auto !important;
  margin: 1rem auto !important;
  overflow: hidden;
  border: 1px solid rgba(227, 231, 240, 0.9);
  border-radius: 1.4rem !important;
  background: var(--chat-surface) !important;
  box-shadow: var(--chat-shadow);
}

.auter > .card {
  width: 100% !important;
  height: auto !important;
  margin: 0 !important;
  padding: 1rem !important;
  border: 0;
  border-radius: 0 !important;
  background: var(--chat-surface) !important;
}

.auter > fieldset:first-child:not(.card),
.auter > fieldset:first-child > fieldset {
  min-height: 3.75rem;
  width: 100% !important;
  margin: 0 !important;
  padding: 0.55rem 0.75rem !important;
  border: 0;
  border-radius: 1rem !important;
  background: linear-gradient(115deg, #29265f, #4a43a4) !important;
  color: #fff;
}

.auter > fieldset:first-child:not(.card) center,
.auter > fieldset:first-child > fieldset center {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 0.45rem;
  min-height: 2.6rem;
}

.t1 {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  min-height: 2.6rem;
  margin: 0 !important;
  padding: 0.55rem !important;
  border: 0 !important;
  border-radius: 0.8rem !important;
  color: #fff !important;
  background: transparent !important;
  font-size: 1.05rem !important;
  text-decoration: none !important;
}

.t1:hover,
.t1:focus-visible {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.17) !important;
}

#main {
  min-width: 0;
}

#users_list,
#message_area {
  width: 100% !important;
  height: min(68vh, 39rem) !important;
  min-height: 19rem;
  padding: 1rem !important;
  overflow: auto;
  border-radius: 0 0 1rem 1rem;
  background: #f8f9fd;
}

#message_area {
  display: flow-root;
  height: min(62vh, 34rem) !important;
  min-height: 18rem;
  background:
    radial-gradient(circle at 1rem 1rem, rgba(101, 88, 211, 0.035) 1px, transparent 1.5px) 0 0 / 18px 18px,
    #f8f9fd;
}

.profile {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100% !important;
  min-height: 4.5rem;
  margin: 0 !important;
  padding: 0.7rem 0.9rem !important;
  border: 0 !important;
  border-bottom: 1px solid var(--chat-border) !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: none !important;
}

.profile img,
table img {
  width: 2.85rem;
  height: 2.85rem;
  object-fit: cover;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(23, 32, 51, 0.15);
}

.sender,
.receiver {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  width: fit-content;
  max-width: min(76%, 30rem);
  min-width: 0;
  margin: 0.1rem 0 !important;
  padding: 0 !important;
  overflow-wrap: anywhere;
  border: 0 !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 2px 6px rgba(25, 34, 57, 0.07);
}

.sender > br,
.receiver > br,
.sender > hr,
.receiver > hr {
  display: none !important;
}

.message-avatar {
  display: block;
  clear: both;
  width: fit-content;
  margin: 0.2rem 0 0.1rem;
  line-height: 0;
}

.sender-avatar {
  float: right;
}

.receiver-avatar {
  float: left;
}

.message-avatar a {
  display: block;
}

.message-avatar img {
  width: 1.8rem;
  height: 1.8rem;
  object-fit: cover;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(23, 32, 51, 0.14);
}

.sender > a:not(:first-of-type),
.receiver > a:not(:first-of-type) {
  flex: 0 0 auto;
  float: none !important;
  margin: 0 !important;
  line-height: 1;
}

.sender > a:not(:first-of-type) i,
.receiver > a:not(:first-of-type) i {
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.sender {
  float: right;
  clear: both;
  color: var(--chat-ink);
  background: #fff;
}

.receiver {
  float: left;
  clear: both;
  color: #fff;
  background: linear-gradient(135deg, #6d63db, #534ac4);
}

.sender p,
.receiver p {
  display: block;
  flex: 0 1 auto;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  margin: 0 !important;
  padding: 0.2rem 0.4rem;
  border-radius: 0.75rem;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.sender p.row {
  margin: 0 !important;
  flex: none;
}

.sender p {
  background: #f0f1f8 !important;
}

.receiver p {
  background: transparent !important;
}

.form-control,
input[type="text"],
input[type="password"],
input[type="file"],
textarea,
select {
  max-width: 100%;
  border: 1px solid var(--chat-border) !important;
  border-radius: 0.75rem !important;
  color: var(--chat-ink);
  background-color: #fff;
  box-shadow: none;
}

.form-control:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: #8e86e4 !important;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(101, 88, 211, 0.15) !important;
}

.btn,
input[type="submit"],
button[type="submit"] {
  min-height: 2.65rem;
  border: 0 !important;
  border-radius: 0.75rem !important;
  color: #fff !important;
  background: linear-gradient(120deg, var(--chat-primary), #8176e2) !important;
  font-weight: 650;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.btn:hover,
input[type="submit"]:hover,
button[type="submit"]:hover {
  color: #fff !important;
  background: linear-gradient(120deg, var(--chat-primary-dark), #7268d5) !important;
  box-shadow: 0 7px 18px rgba(84, 74, 196, 0.2);
  transform: translateY(-1px);
}

#myInput {
  width: 100% !important;
  margin: 0 0 0.85rem !important;
  border-radius: 0.8rem !important;
  background-color: #fff;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 0.9rem;
  background: #fff !important;
}

th {
  padding: 0.8rem 0.9rem;
  color: #fff !important;
  background: #302d69 !important;
  text-align: left;
}

td {
  padding: 0.8rem;
  border-bottom: 1px solid var(--chat-border);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover,
table tr:not(.header):hover {
  background: #f5f4ff;
}

body > fieldset,
body > center > fieldset {
  width: min(100%, 32rem) !important;
  margin: clamp(1rem, 7vh, 4rem) auto !important;
  padding: clamp(1.25rem, 4vw, 2.25rem) !important;
  border: 1px solid var(--chat-border) !important;
  border-radius: 1.4rem !important;
  background: var(--chat-surface) !important;
  box-shadow: var(--chat-shadow);
}

body > fieldset form input[type="text"],
body > fieldset form input[type="password"],
body > center > fieldset form input {
  width: 100% !important;
  margin: 0.35rem 0 !important;
}

body > fieldset form input[type="submit"],
body > center > fieldset form input[type="submit"] {
  width: 100%;
  margin: 0.5rem 0 !important;
}

body > fieldset h2,
body > center > fieldset h5 {
  color: var(--chat-ink);
}

body > fieldset .card-header,
body > center > fieldset .card-header {
  border: 0;
  border-radius: 0.8rem;
  background: #f4f3ff;
}

body > div:not(.auter) {
  max-width: 52rem;
  margin: 1rem auto;
}

#pus {
  max-width: 100%;
  padding: 1rem;
  border-radius: 1rem;
  background: #fff !important;
  box-shadow: var(--chat-shadow);
}

ol.card {
  padding: 1.25rem 1.5rem 1.25rem 2.5rem;
  border: 1px solid var(--chat-border);
  border-radius: 1rem;
  background: #fff;
  text-align: left;
}

ol.card h4 {
  margin: 1rem 0 0.5rem !important;
  padding: 0.6rem 0.8rem;
  border-radius: 0.65rem;
  color: #312d6f;
  background: #f2f1ff;
  text-align: left;
}

.audio {
  display: grid;
  place-items: center;
  width: min(100%, 28rem) !important;
  min-height: 18rem;
  height: auto !important;
  margin: clamp(1.5rem, 10vh, 5rem) auto !important;
  padding: 2rem !important;
  border: 1px solid var(--chat-border) !important;
  border-radius: 1.5rem !important;
  background: #fff;
  box-shadow: var(--chat-shadow);
}

.audio::before {
  content: "\f130";
  color: var(--chat-primary);
  font: 900 3rem "Font Awesome 5 Free";
}

audio {
  width: 100%;
  max-width: 22rem;
}

video,
table img {
  max-width: 100%;
}

.card-body {
  width: min(100%, 38rem) !important;
  margin: 0 auto !important;
}

.auter > .card > img.card-image,
.auter > .card > img.card-image-bottom {
  display: inline-block;
  width: 30.5% !important;
  height: 9rem !important;
  margin: 0.65rem 0.5% !important;
  border-radius: 0.9rem;
  object-fit: cover;
}

.home-showcase {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 1.25rem;
}

.home-visual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.home-visual-card,
.home-landscape {
  position: relative;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 1rem;
  background: linear-gradient(135deg, #6e64db, #43b9ae);
  box-shadow: 0 10px 24px rgba(44, 49, 103, 0.14);
}

.home-visual-card {
  display: grid;
  min-height: 10rem;
  align-items: end;
}

.home-visual-card::before {
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  color: rgba(255, 255, 255, 0.45);
  font: 900 3.5rem "Font Awesome 5 Free";
  transform: translate(-50%, -50%);
}

.science-card {
  background: linear-gradient(145deg, #7469e4, #a48df0 55%, #f2afce);
}

.science-card::before {
  content: "\f0eb";
}

.world-card {
  background: linear-gradient(145deg, #21a99c, #54c9ba 55%, #b4e9d8);
}

.world-card::before {
  content: "\f0ac";
}

.home-visual-card > img,
.home-landscape > img {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-visual-card > img {
  opacity: 0.82;
  mix-blend-mode: soft-light;
}

.home-visual-caption {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.7rem;
  padding: 0.6rem 0.75rem;
  color: #fff;
  background: linear-gradient(transparent, rgba(28, 29, 66, 0.78));
  font-size: 0.84rem;
  font-weight: 650;
}

.home-visual-caption i {
  font-size: 0.9rem;
}

.home-landscape {
  display: flex;
  min-height: 6rem;
  align-items: center;
  padding: 0.9rem;
  background: linear-gradient(115deg, #29265f, #534ac4 58%, #36a99e);
}

.home-landscape > img {
  opacity: 0.34;
}

.home-landscape-caption {
  display: flex;
  position: relative;
  align-items: center;
  gap: 0.8rem;
  color: #fff;
}

.home-landscape-icon {
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.15);
  font-size: 1.15rem;
}

.home-landscape-caption strong,
.home-landscape-caption small {
  display: block;
}

.home-landscape-caption strong {
  font-size: 0.95rem;
}

.home-landscape-caption small {
  margin-top: 0.15rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
}

#main > form.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #fff;
}

#main > form.form-inline textarea {
  flex: 1 1 70%;
  min-height: 2.8rem;
}

#main > form.form-inline button {
  flex: 0 0 3rem;
}

#main > form.form-inline input[type="file"] {
  flex: 1 1 100%;
}

@media (max-width: 600px) {
  body {
    padding: 0.65rem;
  }

  .auter {
    width: 100% !important;
    margin: 0 auto !important;
    border-radius: 1rem !important;
  }

  .auter > .card {
    padding: 0.7rem !important;
  }

  #users_list,
  #message_area {
    height: calc(100dvh - 8.5rem) !important;
    min-height: 16rem;
    padding: 0.7rem !important;
  }

  #message_area {
    height: calc(100dvh - 13rem) !important;
    min-height: 14rem;
  }

  .sender,
  .receiver {
    max-width: 90%;
  }

  .home-visual-grid {
    gap: 0.55rem;
  }

  .home-visual-card {
    min-height: 8.5rem;
  }

  .home-visual-caption {
    padding: 0.5rem;
    font-size: 0.75rem;
  }

  body > fieldset,
  body > center > fieldset {
    margin: 0.5rem auto !important;
    border-radius: 1rem !important;
  }

  td {
    padding: 0.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
