.ec-app,
.ec-app * {
  box-sizing: border-box;
}

.ec-app {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  --ec-bg: #ffffff;
  --ec-text: #000000;
  --ec-muted: #666666;
  --ec-line: #d9d9d9;
  --ec-soft: #f5f5f5;
  --ec-orange: #ff8a00;
  --ec-green: #19a15f;
  --ec-red: #b00020;
  color: var(--ec-text);
  font-family: Helvetica, Arial, Montserrat, sans-serif;
  line-height: 1.45;
}

.ec-shell {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 24px clamp(16px, 3vw, 48px);
}

.ec-header-card,
.ec-card,
.ec-day-panel,
.ec-notice {
  background: var(--ec-bg);
  border: 1px solid var(--ec-line);
  border-radius: 10px;
}

.ec-header-card {
  padding: 28px;
  margin-bottom: 16px;
  background: #000000;
  color: #ffffff;
}

.ec-header-card h2,
.ec-card h3,
.ec-day-panel h4 {
  margin: 0;
  letter-spacing: -0.02em;
}

.ec-header-card h2 {
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
  margin-bottom: 14px;
}

.ec-header-card p,
.ec-card p,
.ec-day-panel p {
  margin: 8px 0 0;
}

.ec-kicker {
  margin: 0 0 8px !important;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 700;
}

.ec-card {
  padding: 22px;
  margin-bottom: 16px;
}

.ec-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.ec-form-grid label,
.ec-position {
  display: grid;
  gap: 8px;
}

.ec-form-grid span {
  font-weight: 700;
  font-size: 14px;
}

.ec-form-grid input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--ec-line);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--ec-text);
  background: var(--ec-bg);
  font: inherit;
  outline: none;
}

.ec-form-grid input:focus {
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.ec-button,
.ec-app button.ec-button {
  min-height: 44px;
  border: 1px solid #000000;
  border-radius: 10px;
  background: #000000;
  color: #ffffff;
  padding: 10px 16px;
  font-family: Helvetica, Arial, Montserrat, sans-serif;
  font-size: 16px !important;
  line-height: 1.2;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.ec-button:hover {
  transform: translateY(-1px);
}

.ec-button:disabled,
.ec-button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.ec-button-secondary,
.ec-app button.ec-button-secondary {
  background: #ffffff;
  color: #000000;
}

.ec-helper,
.ec-user-summary,
.ec-save-bar p,
.ec-empty {
  color: var(--ec-muted);
  font-size: 14px;
}

.ec-calendar-top,
.ec-save-bar,
.ec-panel-head,
.ec-panel-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.ec-month-controls,
.ec-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ec-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 18px 0;
  color: var(--ec-muted);
  font-size: 14px;
}

.ec-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 10px;
  margin-right: 6px;
  border: 1px solid #000000;
}

.ec-dot-open { background: var(--ec-orange); }
.ec-dot-full { background: var(--ec-green); }
.ec-dot-muted { background: #ffffff; }

.ec-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.ec-calendar.ec-loading {
  opacity: 0.55;
  pointer-events: none;
}

.ec-day-head {
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  padding: 10px 4px;
  border-bottom: 1px solid var(--ec-line);
}

.ec-day,
.ec-app button.ec-day {
  min-height: 118px;
  border: 1px solid var(--ec-line);
  border-radius: 10px;
  background: #ffffff;
  color: #000000;
  padding: 12px;
  text-align: left;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

.ec-day:disabled {
  cursor: default;
}

.ec-day-number {
  display: block;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.ec-day-small {
  font-size: 13px;
  font-weight: 700;
}

.ec-service-title {
  display: block;
  margin: 2px 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.18;
  color: #000000;
  word-break: break-word;
}

.ec-service-title-panel {
  margin-top: 5px !important;
  font-size: 15px;
}

.ec-schedule-item em {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-weight: 800;
  color: #000000;
}

.ec-day-muted,
.ec-day-locked {
  background: var(--ec-soft) !important;
  color: #777777 !important;
}

.ec-day-open {
  border-color: var(--ec-orange) !important;
  background: rgba(255, 138, 0, 0.12) !important;
}

.ec-day-full {
  border-color: var(--ec-green) !important;
  background: rgba(25, 161, 95, 0.14) !important;
}

.ec-day-selected {
  box-shadow: inset 0 0 0 2px #000000;
}

.ec-day-mine {
  outline: 2px dashed #000000;
  outline-offset: -5px;
}

.ec-day-badge {
  display: inline-flex;
  width: fit-content;
  border: 1px solid #000000;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  background: #ffffff;
}

.ec-day-empty {
  visibility: hidden;
}

.ec-day-panel {
  margin-top: 18px;
  padding: 18px;
}

.ec-icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid #000000;
  border-radius: 10px;
  background: #ffffff;
  color: #000000;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.ec-panel-status {
  display: inline-flex;
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 800;
}

.ec-open-text {
  border: 1px solid var(--ec-orange);
  color: #000000;
  background: rgba(255, 138, 0, 0.12);
}

.ec-full-text {
  border: 1px solid var(--ec-green);
  color: #000000;
  background: rgba(25, 161, 95, 0.14);
}

.ec-my-day {
  border: 1px solid #000000;
  border-radius: 10px;
  padding: 10px;
}

.ec-positions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.ec-position {
  grid-template-columns: auto 1fr;
  align-items: start;
  border: 1px solid var(--ec-line);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
}

.ec-position input {
  margin-top: 4px;
  accent-color: #000000;
}

.ec-position strong,
.ec-position small {
  display: block;
}

.ec-position small {
  margin-top: 2px;
  color: var(--ec-muted);
}

.ec-position-taken {
  background: var(--ec-soft);
  cursor: not-allowed;
}

.ec-position-selected {
  border-color: #000000;
  box-shadow: inset 0 0 0 2px #000000;
}

.ec-save-bar {
  border-top: 1px solid var(--ec-line);
  margin-top: 20px;
  padding-top: 18px;
}

.ec-schedule-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ec-schedule-item {
  border: 1px solid var(--ec-line);
  border-radius: 10px;
  padding: 12px;
}

.ec-schedule-item strong,
.ec-schedule-item span {
  display: block;
}

.ec-schedule-item span {
  color: var(--ec-muted);
  margin-top: 3px;
}

.ec-notice {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99999;
  max-width: min(420px, calc(100vw - 40px));
  padding: 14px 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
  font-weight: 700;
}

.ec-notice-info,
.ec-notice-success {
  background: #ffffff;
  color: #000000;
  border-color: #000000;
}

.ec-notice-error {
  border-color: var(--ec-red);
  color: var(--ec-red);
  background: #ffffff;
}

@media (max-width: 900px) {
  .ec-calendar {
    gap: 6px;
  }

  .ec-day,
  .ec-app button.ec-day {
    min-height: 86px;
    padding: 9px;
  }

  .ec-day-number {
    font-size: 18px;
  }

  .ec-positions,
  .ec-schedule-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .ec-app {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .ec-shell {
    padding: 14px 10px;
  }

  .ec-header-card,
  .ec-card {
    padding: 18px;
  }

  .ec-form-grid,
  .ec-calendar-top,
  .ec-save-bar,
  .ec-panel-head,
  .ec-panel-actions {
    grid-template-columns: 1fr;
    display: grid;
  }

  .ec-month-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .ec-calendar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ec-day-head,
  .ec-day-muted,
  .ec-day-empty {
    display: none !important;
  }
}

.ec-attendees-title {
  margin: 18px 0 10px;
  font-size: 15px;
  font-weight: 800;
}

.ec-attendees {
  margin: 12px 0 18px;
  padding-left: 22px;
}

.ec-attendees li {
  border: 1px solid var(--ec-line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

.ec-attendees strong,
.ec-attendees small {
  display: block;
}

.ec-attendees small {
  color: var(--ec-muted);
  margin-top: 2px;
}
