:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #152322;
  background: #f6f7f5;
}

* { box-sizing: border-box; }

body {
  min-height: 100svh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.dialer {
  width: min(100%, 380px);
  padding: 40px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 20px 60px rgb(22 43 38 / 6%), 0 2px 8px rgb(22 43 38 / 3%);
}

.mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 28px;
  border-radius: 14px;
  background: #e5f4ed;
  color: #16764e;
  font-size: 25px;
  line-height: 1;
}

h1 {
  margin: 0;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.3;
  text-wrap: balance;
}

.intro {
  margin: 8px 0 32px;
  color: #66716e;
  font-size: 14px;
  line-height: 1.6;
}

label {
  display: block;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 600;
}

input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid #d7dfdb;
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: inherit;
  font: inherit;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  text-align: left;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input::placeholder { color: #a4afaa; }
input:focus-visible { border-color: #18845a; box-shadow: 0 0 0 3px rgb(24 132 90 / 14%); }
input:disabled { background: #f6f7f5; color: #68736f; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }

button {
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  transition: background-color 150ms ease, box-shadow 150ms ease, scale 150ms ease;
}

button:focus-visible { outline: 3px solid rgb(24 132 90 / 35%); outline-offset: 3px; }
button:active:not(:disabled) { scale: .96; }
button:disabled { cursor: default; opacity: .5; }

.dial { flex: 1; background: #157c54; color: #fff; box-shadow: 0 4px 10px rgb(21 124 84 / 17%); }
.dial:hover:not(:disabled) { background: #0f6946; }
.hangup { flex: 1; background: #f7e9e8; color: #a6342d; }
.hangup:hover:not(:disabled) { background: #f3d9d7; }
.phone-dial { flex: none; background: #e5f4ed; color: #126943; }
.phone-dial:hover:not(:disabled) { background: #d5ecdf; }

.mic-control { margin-top: 22px; }
.audience-control { margin-top: 22px; }
.audience-control[hidden] { display: none; }
select { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid #d7dfdb; border-radius: 12px; background: #fff; color: inherit; font: inherit; font-size: 14px; }
select:focus-visible { outline: 3px solid rgb(24 132 90 / 35%); outline-offset: 3px; }
.audience-status { margin: 8px 0 0; color: #66716e; font-size: 12px; line-height: 1.5; }
.audience-status[data-state="error"] { color: #a6342d; }
.mic-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; color: #66716e; font-size: 13px; }
.mic-label label { margin: 0; font-size: inherit; font-weight: 500; }
.mic-label output { font-variant-numeric: tabular-nums; direction: ltr; }
input[type="range"] { display: block; width: 100%; height: 20px; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; accent-color: #157c54; cursor: pointer; }
input[type="range"]:focus-visible { outline: 3px solid rgb(24 132 90 / 35%); outline-offset: 3px; border: 0; box-shadow: none; }

.status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
  margin: 24px 0 0;
  color: #66716e;
  font-size: 13px;
  line-height: 1.5;
}

.status-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #a8b4ad; }
.status[data-state="dialing"] .status-dot { background: #d49831; }
.status[data-state="connecting"] .status-dot { background: #d49831; }
.status[data-state="connected"] .status-dot { background: #16885a; }
.status[data-state="error"] .status-dot { background: #c3443d; }

.participants { margin: 8px 0 0; color: #66716e; font-size: 13px; font-variant-numeric: tabular-nums; }

.phone-form { margin-top: 28px; padding-top: 26px; border-top: 1px solid #e8ece9; }
.optional { color: #87928d; font-weight: 400; }
.phone-actions { display: flex; gap: 10px; }
.phone-actions input { min-width: 0; flex: 1; }
.phone-calls { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.phone-calls:empty { display: none; }
.phone-call { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; background: #f6f7f5; font-size: 12px; line-height: 1.5; }
.phone-call-number { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.phone-call-state { color: #66716e; text-align: end; }
.phone-call[data-state="connected"] .phone-call-state { color: #157c54; }
.phone-call[data-state="error"] .phone-call-state { color: #a6342d; }

@media (max-width: 360px) {
  .phone-actions { flex-direction: column; }
}

@media (max-width: 480px) {
  body { padding: 16px; }
  .dialer { padding: 30px 24px; border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  input, button { transition: none; }
}

.transport-control { margin-bottom: 22px; }
select:disabled { background: #f6f7f5; color: #68736f; }
