.mathias-widget {
  position: fixed;
  right: clamp(14px, 2.5vw, 28px);
  bottom: clamp(14px, 2.5vw, 28px);
  z-index: 950;
  font-family: var(--sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
}

.mathias-launcher {
  display: inline-flex;
  min-height: 54px;
  padding: 8px 18px 8px 9px;
  align-items: center;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  background: #063942;
  color: #fff;
  box-shadow: 0 16px 40px rgba(3, 39, 46, .28);
  cursor: pointer;
  font: inherit;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .02em;
  gap: 10px;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.mathias-launcher:hover,
.mathias-launcher:focus-visible {
  background: #0f6673;
  box-shadow: 0 18px 48px rgba(3, 39, 46, .34);
  transform: translateY(-2px);
}

 .mathias-launcher:focus-visible,
.mathias-close:focus-visible,
.mathias-choice:focus-visible,
.mathias-announcement__close:focus-visible {
  outline: 3px solid #d6b675;
  outline-offset: 3px;
}

.mathias-launcher__mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #0f6673;
  font-family: var(--display, Georgia, serif);
  font-size: 1.15rem;
  font-weight: 800;
}

.mathias-launcher__mark,
.mathias-panel__avatar {
  overflow: hidden;
  border: 1px solid rgba(15, 102, 115, .16);
  background: #fff;
}

.mathias-launcher__mark img,
.mathias-panel__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mathias-announcement {
  position: fixed;
  right: clamp(14px, 2.5vw, 28px);
  bottom: clamp(82px, 7vw, 96px);
  left: auto;
  width: min(286px, calc(100vw - 28px));
  padding: 15px 48px 15px 16px;
  border: 1px solid rgba(15, 102, 115, .18);
  border-radius: 16px 16px 16px 5px;
  background: #fffdf8;
  box-shadow: 0 16px 42px rgba(3, 39, 46, .2);
  color: #294d54;
}

.mathias-announcement[hidden] {
  display: none;
}

.mathias-announcement__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 102, 115, .1);
  color: #0b5965;
  cursor: pointer;
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
}

.mathias-announcement p {
  margin: 0;
  font-size: .82rem;
  line-height: 1.42;
}

.mathias-announcement p strong,
.mathias-announcement p span {
  display: block;
}

.mathias-announcement p strong {
  margin-bottom: 2px;
  color: #063942;
  font-size: .9rem;
}

.mathias-panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  width: min(380px, calc(100vw - 28px));
  max-height: min(660px, calc(100vh - 110px));
  overflow: auto;
  border: 1px solid rgba(15, 102, 115, .18);
  border-radius: 24px;
  background: #fffdf8;
  box-shadow: 0 26px 80px rgba(3, 39, 46, .28);
  color: #153f47;
}

.mathias-panel[hidden] {
  display: none;
}

.mathias-panel__header {
  display: flex;
  padding: 20px 20px 16px;
  align-items: center;
  border-bottom: 1px solid rgba(15, 102, 115, .12);
  background: linear-gradient(145deg, #edf7f4, #fffdf8);
  justify-content: space-between;
  gap: 16px;
}

.mathias-panel__identity {
  display: flex;
  align-items: center;
  gap: 11px;
}

.mathias-panel__avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: #0f6673;
  color: #fff;
  font-family: var(--display, Georgia, serif);
  font-size: 1.22rem;
  font-weight: 800;
}

.mathias-panel__identity strong,
.mathias-panel__identity span {
  display: block;
}

.mathias-panel__identity strong {
  color: #063942;
  font-size: .98rem;
}

.mathias-panel__identity span {
  margin-top: 2px;
  color: #61777b;
  font-size: .72rem;
}

.mathias-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 102, 115, .1);
  color: #0b5965;
  cursor: pointer;
  font: inherit;
  font-size: 1.45rem;
  line-height: 1;
}

.mathias-panel__body {
  padding: 20px;
}

.mathias-message {
  padding: 15px 16px;
  margin: 0 0 16px;
  border-radius: 4px 18px 18px 18px;
  background: #edf7f4;
  color: #294d54;
  font-size: .94rem;
  line-height: 1.55;
}

.mathias-choices {
  display: grid;
  gap: 10px;
}

.mathias-choice {
  display: flex;
  min-height: 58px;
  padding: 13px 15px;
  align-items: center;
  border: 1px solid rgba(15, 102, 115, .22);
  border-radius: 14px;
  background: #fff;
  color: #0b5965;
  font-size: .86rem;
  font-weight: 760;
  line-height: 1.35;
  text-decoration: none;
  justify-content: space-between;
  gap: 14px;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.mathias-choice::after {
  color: #b28a48;
  content: "→";
  font-size: 1.05rem;
}

.mathias-choice:hover,
.mathias-choice:focus-visible {
  border-color: #0f6673;
  background: #0f6673;
  color: #fff;
  transform: translateY(-1px);
}

.mathias-panel__note {
  margin: 16px 2px 0;
  color: #6a7d80;
  font-size: .71rem;
  line-height: 1.5;
}

.mathias-panel__urgent {
  margin: 8px 2px 0;
  color: #7a4a00;
  font-size: .71rem;
  line-height: 1.5;
}

@media (max-width: 539px) {
  .mathias-widget {
    right: 12px;
    bottom: 12px;
  }

  .mathias-launcher {
    min-height: 50px;
    padding-right: 15px;
  }

  .mathias-launcher__mark {
    width: 34px;
    height: 34px;
  }

  .mathias-announcement {
    right: 12px;
    bottom: 74px;
    left: auto;
    width: min(286px, calc(100vw - 24px));
    margin-left: auto;
    margin-right: 0;
  }

  .mathias-panel {
    position: fixed;
    right: 8px;
    bottom: 72px;
    left: 8px;
    width: auto;
    max-height: calc(100vh - 88px);
    border-radius: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mathias-launcher,
  .mathias-choice {
    transition: none;
  }
}

@media print {
  .mathias-widget {
    display: none;
  }
}
