:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f7fb;
  color: #111827;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: #f4f7fb;
}

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

.shell {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 7px;
  width: 100%;
  min-height: 100vh;
  max-width: 100%;
  margin: 0 auto;
  padding: 8px;
  overflow-x: hidden;
}

.topbar,
.dial-panel,
.message-panel,
.activity {
  min-width: 0;
  border: 1px solid #dce3ed;
  border-radius: 8px;
  background: #ffffff;
}

.topbar {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  justify-content: flex-start;
  gap: 7px;
  min-height: 0;
  padding: 8px;
  border-top: 3px solid #0f766e;
}

.title-block {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: #111827;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.1;
}

h2 {
  color: #172033;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
}

p,
label {
  color: #667085;
  font-size: 12px;
  line-height: 1.25;
}

.caller-field {
  display: grid;
  gap: 4px;
  margin-top: 3px;
}

.caller-field span {
  color: #334155;
  font-size: 11px;
  font-weight: 750;
}

.caller-field select {
  max-width: 100%;
  height: 32px;
  font-size: 12px;
}

label {
  display: block;
  margin-top: 2px;
  font-weight: 650;
}

.availability-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 6px 9px;
  color: #065f46;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.availability-toggle:hover:not(:disabled) {
  background: #bbf7d0;
}

.availability-toggle.unavailable {
  color: #4b5563;
  background: #f3f4f6;
  border-color: #d1d5db;
}

.availability-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #059669;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.14);
}

.availability-toggle.unavailable .availability-dot {
  background: #9ca3af;
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.16);
}

.dial-panel,
.message-panel,
.activity {
  padding: 8px;
}

.dial-panel {
  display: grid;
  gap: 6px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.compact-heading {
  align-items: flex-start;
  flex-direction: column;
}

.dial-row,
.call-actions,
.message-row {
  display: grid;
  gap: 6px;
}

.dial-row {
  grid-template-columns: minmax(0, 1fr);
}

.call-actions {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.message-panel {
  display: grid;
  gap: 6px;
}

.message-row {
  grid-template-columns: minmax(0, 1fr);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: #111827;
  background: #ffffff;
  outline: none;
}

input {
  height: 36px;
  padding: 0 12px;
  font-size: 15px;
  font-weight: 650;
}

select {
  width: 100%;
  min-width: 122px;
  height: 32px;
  padding: 0 34px 0 10px;
  color: #172033;
  background-color: #f8fafc;
  font-size: 12px;
  font-weight: 750;
}

textarea {
  min-height: 50px;
  max-height: 120px;
  padding: 10px 11px;
  font-size: 13px;
  line-height: 1.35;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

input::placeholder,
textarea::placeholder {
  color: #98a2b3;
}

button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 9px 12px;
  color: #ffffff;
  background: #0f766e;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

button:hover:not(:disabled) {
  background: #0b5f59;
}

button:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.2);
  outline-offset: 2px;
}

button:disabled {
  color: #7a8596;
  background: #eef2f6;
  border-color: #dce3ed;
  cursor: not-allowed;
}

.secondary-button {
  color: #172033;
  background: #f8fafc;
  border-color: #cbd5e1;
}

.secondary-button:hover:not(:disabled) {
  background: #edf2f7;
}

.danger-button {
  background: #b42318;
}

.danger-button:hover:not(:disabled) {
  background: #912018;
}

.activity {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 102px;
}

ol {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0;
  max-height: 140px;
  margin: 6px 0 0;
  padding: 0;
  overflow: auto;
  color: #475467;
  font-size: 12px;
  list-style: none;
}

li {
  padding: 7px 8px;
  border: 1px solid #edf1f5;
  border-radius: 7px;
  background: #fbfcfe;
  line-height: 1.35;
  word-break: break-word;
}

@media (max-width: 360px) {
  .shell {
    padding: 10px;
  }

  .topbar {
    align-items: stretch;
  }

  .availability-toggle,
  .dial-row {
    width: 100%;
  }

  .call-actions {
    grid-template-columns: 1fr;
  }
}
