:root {
  --pma: #bc544b;
  --pma-soft: #f8ecea;
  --pma-text: #2b2624;
  --pma-muted: #8a817c;
  --pma-page: #f4f0ec;
  --pma-card: #ffffff;
  --pma-off: #efeae6;
  --pma-off-text: #c9c2bc;
  --pma-border: #ece6e1;
  --pma-shadow: 0 10px 30px rgba(80, 54, 48, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--pma-page);
  color: var(--pma-text);
}

button,
input,
select,
textarea {
  font-family: inherit;
}

a {
  color: var(--pma);
}

html:has(.pma-embed),
html:has(.pma-embed) body {
  background: transparent;
}

.pma-embed .pma-page {
  padding: 4px 0 8px;
}

.pma-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 16px 48px;
}

.pma-logo {
  display: block;
  height: 48px;
  width: auto;
  margin: 0 auto 18px;
}

.pma-logo--nav {
  height: 42px;
  margin: 0;
}

.pma-logo--login {
  height: 56px;
  margin: 0 auto 18px;
}

.pma-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.pma-tab {
  appearance: none;
  border: 1px solid #e8e1db;
  background: #fff;
  color: #4a433f;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pma-tab:hover {
  border-color: var(--pma);
  color: var(--pma);
}

.pma-tab.is-active {
  background: var(--pma);
  border-color: var(--pma);
  color: #fff;
}

.pma-card {
  background: var(--pma-card);
  border: 1px solid rgba(188, 84, 75, 0.08);
  border-radius: 22px;
  padding: 28px 32px 36px;
  box-shadow: var(--pma-shadow);
}

.pma-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
}

.pma-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.pma-duration {
  margin: 6px 0 0;
  color: var(--pma-muted);
  font-size: 13px;
}

.pma-tz {
  margin: 0;
  font-size: 12px;
  color: var(--pma-muted);
  text-align: right;
}

.pma-tz span {
  display: block;
  margin-top: 2px;
  color: #5c5550;
  font-weight: 500;
}

.pma-calendar.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

.pma-pick,
.pma-slots h3 {
  text-align: center;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin: 18px 0 8px;
}

.pma-picked {
  text-align: center;
  color: var(--pma-muted);
  font-size: 14px;
  margin: 0 0 22px;
  text-transform: capitalize;
}

.pma-month {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 10px 0 22px;
  font-size: 15px;
  font-weight: 500;
}

.pma-month button {
  appearance: none;
  border: 1px solid var(--pma-border);
  background: #fff;
  color: var(--pma);
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
}

.pma-month button:hover {
  background: var(--pma-soft);
}

.pma-week,
.pma-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  max-width: 420px;
  margin: 0 auto;
}

.pma-week span {
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: #9a918b;
  padding-bottom: 8px;
}

.pma-cell {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}

.pma-day {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #2a2a2a;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.pma-day.is-open:hover {
  background: var(--pma-soft);
  color: var(--pma);
}

.pma-day.is-today:not(.is-off) {
  box-shadow: inset 0 0 0 1px var(--pma);
}

.pma-day.is-off {
  background: var(--pma-off);
  color: var(--pma-off-text);
  cursor: default;
}

.pma-back {
  appearance: none;
  border: 0;
  background: none;
  color: var(--pma);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin: 8px 0 4px;
  padding: 0;
}

.pma-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 560px;
  margin: 0 auto;
}

.pma-groups h4 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6f6762;
}

.pma-slot {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  padding: 11px 12px;
  border: 1px solid var(--pma-border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #3a342f;
}

.pma-slot:hover,
.pma-slot.is-selected {
  border-color: var(--pma);
  color: var(--pma);
  background: var(--pma-soft);
}

.pma-book {
  max-width: 480px;
  margin: 0 auto;
}

.pma-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pma-form label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 6px;
  color: #5c5550;
}

.pma-form input {
  width: 100%;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--pma-border);
  border-radius: 10px;
  background: #fbfaf9;
  font-size: 15px;
  color: var(--pma-text);
}

.pma-form input:focus {
  outline: none;
  background: #fff;
  border-color: var(--pma);
  box-shadow: 0 0 0 3px rgba(188, 84, 75, 0.12);
}

.pma-hp {
  position: absolute;
  left: -9999px;
}

.pma-submit {
  appearance: none;
  border: 0;
  background: var(--pma);
  color: #fff;
  border-radius: 999px;
  padding: 13px 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 4px;
}

.pma-submit:hover {
  filter: brightness(0.97);
}

.pma-submit:disabled {
  opacity: 0.6;
}

.pma-msg,
.pma-empty {
  color: var(--pma-muted);
  text-align: left;
  padding: 4px 0 12px;
  font-size: 13px;
}

.pma-error {
  color: #a32616;
  text-align: center;
  margin-top: 16px;
}

.pma-success {
  text-align: center;
  padding: 36px 12px;
}

.pma-success-kicker {
  color: var(--pma);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.pma-success h2 {
  margin: 0 0 12px;
  font-size: 26px;
  font-weight: 500;
}

.pma-success-note {
  color: var(--pma-muted);
  margin-top: 18px;
}

.admin-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 72px;
}

.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-brand span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pma);
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.admin-nav a {
  text-decoration: none;
  color: #5c5550;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
}

.admin-nav a.is-active,
.admin-nav a:hover {
  background: #fff;
  color: var(--pma);
}

.admin-logout {
  color: var(--pma) !important;
}

.admin-card {
  background: #fff;
  border: 1px solid var(--pma-border);
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--pma-shadow);
}

.admin-card h1,
.admin-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.admin-card h2 {
  font-size: 18px;
  margin-top: 28px;
}

.admin-card p {
  color: #6f6762;
}

.admin-preview {
  width: 100%;
  min-height: 780px;
  border: 0;
  background: var(--pma-page);
  border-radius: 16px;
}

.appt-list {
  display: flex;
  flex-direction: column;
}

.appt {
  display: grid;
  grid-template-columns: 138px minmax(140px, 1.3fr) auto minmax(140px, 1.1fr) 40px;
  gap: 12px 16px;
  align-items: center;
  padding: 14px 4px;
  border-bottom: 1px solid #f0ebe7;
}

.appt.is-muted {
  opacity: 0.72;
}

.appt-when {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.appt-when span {
  font-weight: 500;
  color: var(--pma);
}

.appt-person {
  min-width: 0;
}

.appt-person strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
}

.appt-person small {
  display: block;
  margin-top: 3px;
  color: var(--pma-muted);
  font-size: 12px;
}

.appt-type {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--pma-soft);
  color: var(--pma);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.appt-contact {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}

.appt-contact a {
  color: #5c5550;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appt-contact a:hover {
  color: var(--pma);
}

.appt-actions {
  position: relative;
  justify-self: end;
}

.appt-dots {
  appearance: none;
  border: 0;
  background: transparent;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: #6f6762;
}

.appt-dots:hover {
  background: var(--pma-soft);
  color: var(--pma);
}

.appt-menu {
  position: absolute;
  right: 0;
  top: 36px;
  z-index: 5;
  min-width: 150px;
  background: #fff;
  border: 1px solid var(--pma-border);
  border-radius: 12px;
  box-shadow: var(--pma-shadow);
  padding: 6px;
}

.appt-menu button {
  display: block;
  width: 100%;
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #3a342f;
  cursor: pointer;
}

.appt-menu button:hover {
  background: #f7f4f1;
}

.appt-menu .is-danger {
  color: var(--pma);
}

.appt-modal {
  position: fixed;
  inset: 0;
  background: rgba(43, 38, 36, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 20;
}

.appt-modal-card {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--pma-shadow);
}

.appt-modal-card h2 {
  margin-bottom: 16px;
}

.appt-modal-card select,
.appt-modal-card input[type="date"],
.appt-modal-card input[type="time"] {
  width: 100%;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--pma-border);
  border-radius: 10px;
  background: #fbfaf9;
  font: inherit;
}

.appt-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.appt-ghost {
  appearance: none;
  border: 0;
  background: transparent;
  color: #6f6762;
  font-weight: 600;
  cursor: pointer;
}

.appt-modal-actions .pma-submit {
  width: auto;
}

.admin-ok {
  color: #1a7f37;
  font-weight: 600;
}

.admin-warn {
  color: #9a3412;
  font-weight: 600;
}

.login-box {
  max-width: 420px;
  margin: 16vh auto;
  background: #fff;
  border-radius: 22px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: var(--pma-shadow);
  border: 1px solid var(--pma-border);
}

.login-box h1 {
  font-size: 24px;
  margin: 0 0 8px;
  font-weight: 600;
}

.login-box p {
  color: #6f6762;
  margin: 0 0 24px;
}

.login-box .pma-submit {
  width: auto;
  padding-left: 28px;
  padding-right: 28px;
}

.pma-copy-row {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
}

.pma-copy-row input {
  margin-bottom: 0;
  flex: 1;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
}

.code-block {
  background: #f7f4f1;
  border-radius: 10px;
  padding: 12px;
  overflow: auto;
  font-size: 13px;
}

.admin-type-head,
.admin-type-row,
.admin-hour-row {
  display: grid;
  grid-template-columns: 1.2fr 1.6fr 90px 70px;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.admin-type-head {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8a817c;
  margin-bottom: 10px;
}

.admin-hour-row {
  grid-template-columns: 140px 70px 110px 110px;
}

.admin-type-row input,
.admin-hour-row input,
.pma-form input[type="time"] {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--pma-border);
  border-radius: 10px;
  background: #fbfaf9;
}

@media (max-width: 720px) {
  .pma-groups,
  .pma-form-row,
  .admin-type-head,
  .admin-type-row,
  .admin-hour-row {
    grid-template-columns: 1fr;
  }

  .admin-type-head {
    display: none;
  }

  .pma-card {
    padding: 22px 16px 28px;
  }

  .pma-card-top {
    flex-direction: column;
  }

  .pma-tz {
    text-align: left;
  }

  .pma-title {
    font-size: 16px;
  }

  .appt {
    grid-template-columns: 1fr auto 40px;
    grid-template-areas:
      "when type actions"
      "person person person"
      "contact contact contact";
  }

  .appt-when {
    grid-area: when;
  }

  .appt-person {
    grid-area: person;
  }

  .appt-type {
    grid-area: type;
    justify-self: start;
  }

  .appt-contact {
    grid-area: contact;
  }

  .appt-actions {
    grid-area: actions;
  }
}

.mail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.mail-check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  margin: 4px 0 16px;
  font-size: 13px;
}

.mail-check input {
  width: auto;
  margin: 0;
}

.mail-test-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.mail-test-row input {
  flex: 1;
  margin-bottom: 0;
}

.pma-ghost {
  appearance: none;
  border: 1px solid var(--pma-border);
  background: #fff;
  color: var(--pma);
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.pma-ghost:disabled {
  opacity: 0.6;
}

.mail-tabs {
  justify-content: flex-start;
  margin: 12px 0 18px;
}

.mail-subject-chips,
.mail-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.mail-chip,
.mail-toolbar button {
  appearance: none;
  border: 1px solid var(--pma-border);
  background: #fff;
  color: #5c5550;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.mail-chip:hover,
.mail-toolbar button:hover {
  border-color: var(--pma);
  color: var(--pma);
  background: var(--pma-soft);
}

.mail-toolbar {
  padding: 8px;
  background: #f7f4f1;
  border: 1px solid var(--pma-border);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  margin: 0;
}

.mail-toolbar-sep {
  width: 1px;
  background: #e4ddd7;
  margin: 0 4px;
  align-self: stretch;
}

.mail-editor {
  margin-bottom: 16px;
}

.mail-canvas {
  min-height: 240px;
  padding: 16px 18px;
  border: 1px solid var(--pma-border);
  border-radius: 0 0 12px 12px;
  background: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--pma-text);
  outline: none;
}

.mail-canvas:focus {
  border-color: var(--pma);
}

.mail-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: #5c5550;
}

.mail-source-toggle {
  appearance: none;
  border: 0;
  background: none;
  color: var(--pma);
  font-weight: 600;
  cursor: pointer;
  font-size: 12px;
}

.mail-source {
  width: 100%;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--pma-border);
  border-radius: 12px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
  background: #fbfaf9;
}

.mail-hint {
  font-size: 13px;
}

@media (max-width: 720px) {
  .mail-grid,
  .mail-test-row {
    grid-template-columns: 1fr;
    display: grid;
  }
}
